1#![doc = "MAVLink cubepilot dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{
10 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
11};
12#[allow(unused_imports)]
13use num_derive::FromPrimitive;
14#[allow(unused_imports)]
15use num_derive::ToPrimitive;
16#[allow(unused_imports)]
17use num_traits::FromPrimitive;
18#[allow(unused_imports)]
19use num_traits::ToPrimitive;
20#[cfg(feature = "serde")]
21use serde::{Deserialize, Serialize};
22#[cfg(feature = "ts")]
23use ts_rs::TS;
24pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
25#[cfg_attr(feature = "ts", derive(TS))]
26#[cfg_attr(feature = "ts", ts(export))]
27#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
28#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29#[cfg_attr(feature = "serde", serde(tag = "type"))]
30#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31#[repr(u32)]
32#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
33pub enum ActuatorConfiguration {
34 #[doc = "Do nothing."]
35 ACTUATOR_CONFIGURATION_NONE = 0,
36 #[doc = "Command the actuator to beep now."]
37 ACTUATOR_CONFIGURATION_BEEP = 1,
38 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
40 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
41 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
44 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
45 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
46}
47impl ActuatorConfiguration {
48 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
49}
50impl Default for ActuatorConfiguration {
51 fn default() -> Self {
52 Self::DEFAULT
53 }
54}
55#[cfg_attr(feature = "ts", derive(TS))]
56#[cfg_attr(feature = "ts", ts(export))]
57#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
58#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
59#[cfg_attr(feature = "serde", serde(tag = "type"))]
60#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
61#[repr(u32)]
62#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
63pub enum ActuatorOutputFunction {
64 #[doc = "No function (disabled)."]
65 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
66 #[doc = "Motor 1"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
68 #[doc = "Motor 2"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
70 #[doc = "Motor 3"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
72 #[doc = "Motor 4"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
74 #[doc = "Motor 5"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
76 #[doc = "Motor 6"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
78 #[doc = "Motor 7"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
80 #[doc = "Motor 8"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
82 #[doc = "Motor 9"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
84 #[doc = "Motor 10"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
86 #[doc = "Motor 11"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
88 #[doc = "Motor 12"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
90 #[doc = "Motor 13"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
92 #[doc = "Motor 14"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
94 #[doc = "Motor 15"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
96 #[doc = "Motor 16"]
97 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
98 #[doc = "Servo 1"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
100 #[doc = "Servo 2"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
102 #[doc = "Servo 3"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
104 #[doc = "Servo 4"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
106 #[doc = "Servo 5"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
108 #[doc = "Servo 6"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
110 #[doc = "Servo 7"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
112 #[doc = "Servo 8"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
114 #[doc = "Servo 9"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
116 #[doc = "Servo 10"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
118 #[doc = "Servo 11"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
120 #[doc = "Servo 12"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
122 #[doc = "Servo 13"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
124 #[doc = "Servo 14"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
126 #[doc = "Servo 15"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
128 #[doc = "Servo 16"]
129 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
130}
131impl ActuatorOutputFunction {
132 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
133}
134impl Default for ActuatorOutputFunction {
135 fn default() -> Self {
136 Self::DEFAULT
137 }
138}
139#[cfg_attr(feature = "ts", derive(TS))]
140#[cfg_attr(feature = "ts", ts(export))]
141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
143#[cfg_attr(feature = "serde", serde(tag = "type"))]
144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
145#[repr(u32)]
146#[doc = "Enumeration of the ADSB altimeter types"]
147pub enum AdsbAltitudeType {
148 #[doc = "Altitude reported from a Baro source using QNH reference"]
149 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
150 #[doc = "Altitude reported from a GNSS source"]
151 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
152}
153impl AdsbAltitudeType {
154 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
155}
156impl Default for AdsbAltitudeType {
157 fn default() -> Self {
158 Self::DEFAULT
159 }
160}
161#[cfg_attr(feature = "ts", derive(TS))]
162#[cfg_attr(feature = "ts", ts(export))]
163#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
165#[cfg_attr(feature = "serde", serde(tag = "type"))]
166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
167#[repr(u32)]
168#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
169pub enum AdsbEmitterType {
170 ADSB_EMITTER_TYPE_NO_INFO = 0,
171 ADSB_EMITTER_TYPE_LIGHT = 1,
172 ADSB_EMITTER_TYPE_SMALL = 2,
173 ADSB_EMITTER_TYPE_LARGE = 3,
174 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
175 ADSB_EMITTER_TYPE_HEAVY = 5,
176 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
177 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
178 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
179 ADSB_EMITTER_TYPE_GLIDER = 9,
180 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
181 ADSB_EMITTER_TYPE_PARACHUTE = 11,
182 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
183 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
184 ADSB_EMITTER_TYPE_UAV = 14,
185 ADSB_EMITTER_TYPE_SPACE = 15,
186 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
187 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
188 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
189 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
190}
191impl AdsbEmitterType {
192 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
193}
194impl Default for AdsbEmitterType {
195 fn default() -> Self {
196 Self::DEFAULT
197 }
198}
199bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
200impl AdsbFlags {
201 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
202}
203impl Default for AdsbFlags {
204 fn default() -> Self {
205 Self::DEFAULT
206 }
207}
208bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
209impl AisFlags {
210 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
211}
212impl Default for AisFlags {
213 fn default() -> Self {
214 Self::DEFAULT
215 }
216}
217#[cfg_attr(feature = "ts", derive(TS))]
218#[cfg_attr(feature = "ts", ts(export))]
219#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
221#[cfg_attr(feature = "serde", serde(tag = "type"))]
222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
223#[repr(u32)]
224#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
225pub enum AisNavStatus {
226 #[doc = "Under way using engine."]
227 UNDER_WAY = 0,
228 AIS_NAV_ANCHORED = 1,
229 AIS_NAV_UN_COMMANDED = 2,
230 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
231 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
232 AIS_NAV_MOORED = 5,
233 AIS_NAV_AGROUND = 6,
234 AIS_NAV_FISHING = 7,
235 AIS_NAV_SAILING = 8,
236 AIS_NAV_RESERVED_HSC = 9,
237 AIS_NAV_RESERVED_WIG = 10,
238 AIS_NAV_RESERVED_1 = 11,
239 AIS_NAV_RESERVED_2 = 12,
240 AIS_NAV_RESERVED_3 = 13,
241 #[doc = "Search And Rescue Transponder."]
242 AIS_NAV_AIS_SART = 14,
243 #[doc = "Not available (default)."]
244 AIS_NAV_UNKNOWN = 15,
245}
246impl AisNavStatus {
247 pub const DEFAULT: Self = Self::UNDER_WAY;
248}
249impl Default for AisNavStatus {
250 fn default() -> Self {
251 Self::DEFAULT
252 }
253}
254#[cfg_attr(feature = "ts", derive(TS))]
255#[cfg_attr(feature = "ts", ts(export))]
256#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
258#[cfg_attr(feature = "serde", serde(tag = "type"))]
259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
260#[repr(u32)]
261#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
262pub enum AisType {
263 #[doc = "Not available (default)."]
264 AIS_TYPE_UNKNOWN = 0,
265 AIS_TYPE_RESERVED_1 = 1,
266 AIS_TYPE_RESERVED_2 = 2,
267 AIS_TYPE_RESERVED_3 = 3,
268 AIS_TYPE_RESERVED_4 = 4,
269 AIS_TYPE_RESERVED_5 = 5,
270 AIS_TYPE_RESERVED_6 = 6,
271 AIS_TYPE_RESERVED_7 = 7,
272 AIS_TYPE_RESERVED_8 = 8,
273 AIS_TYPE_RESERVED_9 = 9,
274 AIS_TYPE_RESERVED_10 = 10,
275 AIS_TYPE_RESERVED_11 = 11,
276 AIS_TYPE_RESERVED_12 = 12,
277 AIS_TYPE_RESERVED_13 = 13,
278 AIS_TYPE_RESERVED_14 = 14,
279 AIS_TYPE_RESERVED_15 = 15,
280 AIS_TYPE_RESERVED_16 = 16,
281 AIS_TYPE_RESERVED_17 = 17,
282 AIS_TYPE_RESERVED_18 = 18,
283 AIS_TYPE_RESERVED_19 = 19,
284 #[doc = "Wing In Ground effect."]
285 AIS_TYPE_WIG = 20,
286 AIS_TYPE_WIG_HAZARDOUS_A = 21,
287 AIS_TYPE_WIG_HAZARDOUS_B = 22,
288 AIS_TYPE_WIG_HAZARDOUS_C = 23,
289 AIS_TYPE_WIG_HAZARDOUS_D = 24,
290 AIS_TYPE_WIG_RESERVED_1 = 25,
291 AIS_TYPE_WIG_RESERVED_2 = 26,
292 AIS_TYPE_WIG_RESERVED_3 = 27,
293 AIS_TYPE_WIG_RESERVED_4 = 28,
294 AIS_TYPE_WIG_RESERVED_5 = 29,
295 AIS_TYPE_FISHING = 30,
296 AIS_TYPE_TOWING = 31,
297 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
298 AIS_TYPE_TOWING_LARGE = 32,
299 #[doc = "Dredging or other underwater ops."]
300 AIS_TYPE_DREDGING = 33,
301 AIS_TYPE_DIVING = 34,
302 AIS_TYPE_MILITARY = 35,
303 AIS_TYPE_SAILING = 36,
304 AIS_TYPE_PLEASURE = 37,
305 AIS_TYPE_RESERVED_20 = 38,
306 AIS_TYPE_RESERVED_21 = 39,
307 #[doc = "High Speed Craft."]
308 AIS_TYPE_HSC = 40,
309 AIS_TYPE_HSC_HAZARDOUS_A = 41,
310 AIS_TYPE_HSC_HAZARDOUS_B = 42,
311 AIS_TYPE_HSC_HAZARDOUS_C = 43,
312 AIS_TYPE_HSC_HAZARDOUS_D = 44,
313 AIS_TYPE_HSC_RESERVED_1 = 45,
314 AIS_TYPE_HSC_RESERVED_2 = 46,
315 AIS_TYPE_HSC_RESERVED_3 = 47,
316 AIS_TYPE_HSC_RESERVED_4 = 48,
317 AIS_TYPE_HSC_UNKNOWN = 49,
318 AIS_TYPE_PILOT = 50,
319 #[doc = "Search And Rescue vessel."]
320 AIS_TYPE_SAR = 51,
321 AIS_TYPE_TUG = 52,
322 AIS_TYPE_PORT_TENDER = 53,
323 #[doc = "Anti-pollution equipment."]
324 AIS_TYPE_ANTI_POLLUTION = 54,
325 AIS_TYPE_LAW_ENFORCEMENT = 55,
326 AIS_TYPE_SPARE_LOCAL_1 = 56,
327 AIS_TYPE_SPARE_LOCAL_2 = 57,
328 AIS_TYPE_MEDICAL_TRANSPORT = 58,
329 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
330 AIS_TYPE_NONECOMBATANT = 59,
331 AIS_TYPE_PASSENGER = 60,
332 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
333 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
334 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
335 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
336 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
337 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
338 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
339 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
340 AIS_TYPE_PASSENGER_UNKNOWN = 69,
341 AIS_TYPE_CARGO = 70,
342 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
343 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
344 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
345 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
346 AIS_TYPE_CARGO_RESERVED_1 = 75,
347 AIS_TYPE_CARGO_RESERVED_2 = 76,
348 AIS_TYPE_CARGO_RESERVED_3 = 77,
349 AIS_TYPE_CARGO_RESERVED_4 = 78,
350 AIS_TYPE_CARGO_UNKNOWN = 79,
351 AIS_TYPE_TANKER = 80,
352 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
353 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
354 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
355 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
356 AIS_TYPE_TANKER_RESERVED_1 = 85,
357 AIS_TYPE_TANKER_RESERVED_2 = 86,
358 AIS_TYPE_TANKER_RESERVED_3 = 87,
359 AIS_TYPE_TANKER_RESERVED_4 = 88,
360 AIS_TYPE_TANKER_UNKNOWN = 89,
361 AIS_TYPE_OTHER = 90,
362 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
363 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
364 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
365 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
366 AIS_TYPE_OTHER_RESERVED_1 = 95,
367 AIS_TYPE_OTHER_RESERVED_2 = 96,
368 AIS_TYPE_OTHER_RESERVED_3 = 97,
369 AIS_TYPE_OTHER_RESERVED_4 = 98,
370 AIS_TYPE_OTHER_UNKNOWN = 99,
371}
372impl AisType {
373 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
374}
375impl Default for AisType {
376 fn default() -> Self {
377 Self::DEFAULT
378 }
379}
380bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
381impl AttitudeTargetTypemask {
382 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
383}
384impl Default for AttitudeTargetTypemask {
385 fn default() -> Self {
386 Self::DEFAULT
387 }
388}
389#[cfg_attr(feature = "ts", derive(TS))]
390#[cfg_attr(feature = "ts", ts(export))]
391#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
393#[cfg_attr(feature = "serde", serde(tag = "type"))]
394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
395#[repr(u32)]
396#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
397pub enum AutotuneAxis {
398 #[doc = "Autotune roll axis."]
399 AUTOTUNE_AXIS_ROLL = 1,
400 #[doc = "Autotune pitch axis."]
401 AUTOTUNE_AXIS_PITCH = 2,
402 #[doc = "Autotune yaw axis."]
403 AUTOTUNE_AXIS_YAW = 4,
404}
405impl AutotuneAxis {
406 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
407}
408impl Default for AutotuneAxis {
409 fn default() -> Self {
410 Self::DEFAULT
411 }
412}
413bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
414impl CameraCapFlags {
415 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
416}
417impl Default for CameraCapFlags {
418 fn default() -> Self {
419 Self::DEFAULT
420 }
421}
422#[cfg_attr(feature = "ts", derive(TS))]
423#[cfg_attr(feature = "ts", ts(export))]
424#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
426#[cfg_attr(feature = "serde", serde(tag = "type"))]
427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
428#[repr(u32)]
429#[doc = "Camera Modes."]
430pub enum CameraMode {
431 #[doc = "Camera is in image/photo capture mode."]
432 CAMERA_MODE_IMAGE = 0,
433 #[doc = "Camera is in video capture mode."]
434 CAMERA_MODE_VIDEO = 1,
435 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
436 CAMERA_MODE_IMAGE_SURVEY = 2,
437}
438impl CameraMode {
439 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
440}
441impl Default for CameraMode {
442 fn default() -> Self {
443 Self::DEFAULT
444 }
445}
446#[cfg_attr(feature = "ts", derive(TS))]
447#[cfg_attr(feature = "ts", ts(export))]
448#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
450#[cfg_attr(feature = "serde", serde(tag = "type"))]
451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
452#[repr(u32)]
453#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
454pub enum CameraSource {
455 #[doc = "Default camera source."]
456 CAMERA_SOURCE_DEFAULT = 0,
457 #[doc = "RGB camera source."]
458 CAMERA_SOURCE_RGB = 1,
459 #[doc = "IR camera source."]
460 CAMERA_SOURCE_IR = 2,
461 #[doc = "NDVI camera source."]
462 CAMERA_SOURCE_NDVI = 3,
463}
464impl CameraSource {
465 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
466}
467impl Default for CameraSource {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[cfg_attr(feature = "ts", derive(TS))]
473#[cfg_attr(feature = "ts", ts(export))]
474#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
476#[cfg_attr(feature = "serde", serde(tag = "type"))]
477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
478#[repr(u32)]
479#[doc = "Camera tracking modes"]
480pub enum CameraTrackingMode {
481 #[doc = "Not tracking"]
482 CAMERA_TRACKING_MODE_NONE = 0,
483 #[doc = "Target is a point"]
484 CAMERA_TRACKING_MODE_POINT = 1,
485 #[doc = "Target is a rectangle"]
486 CAMERA_TRACKING_MODE_RECTANGLE = 2,
487}
488impl CameraTrackingMode {
489 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
490}
491impl Default for CameraTrackingMode {
492 fn default() -> Self {
493 Self::DEFAULT
494 }
495}
496#[cfg_attr(feature = "ts", derive(TS))]
497#[cfg_attr(feature = "ts", ts(export))]
498#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
500#[cfg_attr(feature = "serde", serde(tag = "type"))]
501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
502#[repr(u32)]
503#[doc = "Camera tracking status flags"]
504pub enum CameraTrackingStatusFlags {
505 #[doc = "Camera is not tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
507 #[doc = "Camera is tracking"]
508 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
509 #[doc = "Camera tracking in error state"]
510 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
511}
512impl CameraTrackingStatusFlags {
513 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
514}
515impl Default for CameraTrackingStatusFlags {
516 fn default() -> Self {
517 Self::DEFAULT
518 }
519}
520bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
521impl CameraTrackingTargetData {
522 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
523}
524impl Default for CameraTrackingTargetData {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[cfg_attr(feature = "ts", derive(TS))]
530#[cfg_attr(feature = "ts", ts(export))]
531#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
533#[cfg_attr(feature = "serde", serde(tag = "type"))]
534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
535#[repr(u32)]
536#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
537pub enum CameraZoomType {
538 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
539 ZOOM_TYPE_STEP = 0,
540 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
541 ZOOM_TYPE_CONTINUOUS = 1,
542 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
543 ZOOM_TYPE_RANGE = 2,
544 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
545 ZOOM_TYPE_FOCAL_LENGTH = 3,
546 #[doc = "Zoom value as horizontal field of view in degrees."]
547 ZOOM_TYPE_HORIZONTAL_FOV = 4,
548}
549impl CameraZoomType {
550 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
551}
552impl Default for CameraZoomType {
553 fn default() -> Self {
554 Self::DEFAULT
555 }
556}
557#[cfg_attr(feature = "ts", derive(TS))]
558#[cfg_attr(feature = "ts", ts(export))]
559#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
561#[cfg_attr(feature = "serde", serde(tag = "type"))]
562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
563#[repr(u32)]
564pub enum CanFilterOp {
565 CAN_FILTER_REPLACE = 0,
566 CAN_FILTER_ADD = 1,
567 CAN_FILTER_REMOVE = 2,
568}
569impl CanFilterOp {
570 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
571}
572impl Default for CanFilterOp {
573 fn default() -> Self {
574 Self::DEFAULT
575 }
576}
577#[cfg_attr(feature = "ts", derive(TS))]
578#[cfg_attr(feature = "ts", ts(export))]
579#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
581#[cfg_attr(feature = "serde", serde(tag = "type"))]
582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
583#[repr(u32)]
584#[doc = "Possible responses from a CELLULAR_CONFIG message."]
585pub enum CellularConfigResponse {
586 #[doc = "Changes accepted."]
587 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
588 #[doc = "Invalid APN."]
589 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
590 #[doc = "Invalid PIN."]
591 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
592 #[doc = "Changes rejected."]
593 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
594 #[doc = "PUK is required to unblock SIM card."]
595 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
596}
597impl CellularConfigResponse {
598 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
599}
600impl Default for CellularConfigResponse {
601 fn default() -> Self {
602 Self::DEFAULT
603 }
604}
605#[cfg_attr(feature = "ts", derive(TS))]
606#[cfg_attr(feature = "ts", ts(export))]
607#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
609#[cfg_attr(feature = "serde", serde(tag = "type"))]
610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
611#[repr(u32)]
612#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
613pub enum CellularNetworkFailedReason {
614 #[doc = "No error"]
615 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
616 #[doc = "Error state is unknown"]
617 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
618 #[doc = "SIM is required for the modem but missing"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
620 #[doc = "SIM is available, but not usable for connection"]
621 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
622}
623impl CellularNetworkFailedReason {
624 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
625}
626impl Default for CellularNetworkFailedReason {
627 fn default() -> Self {
628 Self::DEFAULT
629 }
630}
631#[cfg_attr(feature = "ts", derive(TS))]
632#[cfg_attr(feature = "ts", ts(export))]
633#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
635#[cfg_attr(feature = "serde", serde(tag = "type"))]
636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
637#[repr(u32)]
638#[doc = "Cellular network radio type"]
639pub enum CellularNetworkRadioType {
640 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
641 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
642 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
643 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
644 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
645}
646impl CellularNetworkRadioType {
647 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
648}
649impl Default for CellularNetworkRadioType {
650 fn default() -> Self {
651 Self::DEFAULT
652 }
653}
654#[cfg_attr(feature = "ts", derive(TS))]
655#[cfg_attr(feature = "ts", ts(export))]
656#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
658#[cfg_attr(feature = "serde", serde(tag = "type"))]
659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
660#[repr(u32)]
661#[doc = "These flags encode the cellular network status"]
662pub enum CellularStatusFlag {
663 #[doc = "State unknown or not reportable."]
664 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
665 #[doc = "Modem is unusable"]
666 CELLULAR_STATUS_FLAG_FAILED = 1,
667 #[doc = "Modem is being initialized"]
668 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
669 #[doc = "Modem is locked"]
670 CELLULAR_STATUS_FLAG_LOCKED = 3,
671 #[doc = "Modem is not enabled and is powered down"]
672 CELLULAR_STATUS_FLAG_DISABLED = 4,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
674 CELLULAR_STATUS_FLAG_DISABLING = 5,
675 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
676 CELLULAR_STATUS_FLAG_ENABLING = 6,
677 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
678 CELLULAR_STATUS_FLAG_ENABLED = 7,
679 #[doc = "Modem is searching for a network provider to register"]
680 CELLULAR_STATUS_FLAG_SEARCHING = 8,
681 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
682 CELLULAR_STATUS_FLAG_REGISTERED = 9,
683 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
684 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
685 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
686 CELLULAR_STATUS_FLAG_CONNECTING = 11,
687 #[doc = "One or more packet data bearers is active and connected"]
688 CELLULAR_STATUS_FLAG_CONNECTED = 12,
689}
690impl CellularStatusFlag {
691 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
692}
693impl Default for CellularStatusFlag {
694 fn default() -> Self {
695 Self::DEFAULT
696 }
697}
698#[cfg_attr(feature = "ts", derive(TS))]
699#[cfg_attr(feature = "ts", ts(export))]
700#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
702#[cfg_attr(feature = "serde", serde(tag = "type"))]
703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
704#[repr(u32)]
705#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
706pub enum CompMetadataType {
707 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
708 COMP_METADATA_TYPE_GENERAL = 0,
709 #[doc = "Parameter meta data."]
710 COMP_METADATA_TYPE_PARAMETER = 1,
711 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
712 COMP_METADATA_TYPE_COMMANDS = 2,
713 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
714 COMP_METADATA_TYPE_PERIPHERALS = 3,
715 #[doc = "Meta data for the events interface."]
716 COMP_METADATA_TYPE_EVENTS = 4,
717 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
718 COMP_METADATA_TYPE_ACTUATORS = 5,
719}
720impl CompMetadataType {
721 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
722}
723impl Default for CompMetadataType {
724 fn default() -> Self {
725 Self::DEFAULT
726 }
727}
728#[cfg_attr(feature = "ts", derive(TS))]
729#[cfg_attr(feature = "ts", ts(export))]
730#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
732#[cfg_attr(feature = "serde", serde(tag = "type"))]
733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
734#[repr(u32)]
735#[doc = "Indicates the ESC connection type."]
736pub enum EscConnectionType {
737 #[doc = "Traditional PPM ESC."]
738 ESC_CONNECTION_TYPE_PPM = 0,
739 #[doc = "Serial Bus connected ESC."]
740 ESC_CONNECTION_TYPE_SERIAL = 1,
741 #[doc = "One Shot PPM ESC."]
742 ESC_CONNECTION_TYPE_ONESHOT = 2,
743 #[doc = "I2C ESC."]
744 ESC_CONNECTION_TYPE_I2C = 3,
745 #[doc = "CAN-Bus ESC."]
746 ESC_CONNECTION_TYPE_CAN = 4,
747 #[doc = "DShot ESC."]
748 ESC_CONNECTION_TYPE_DSHOT = 5,
749}
750impl EscConnectionType {
751 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
752}
753impl Default for EscConnectionType {
754 fn default() -> Self {
755 Self::DEFAULT
756 }
757}
758bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
759impl EscFailureFlags {
760 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
761}
762impl Default for EscFailureFlags {
763 fn default() -> Self {
764 Self::DEFAULT
765 }
766}
767bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
768impl EstimatorStatusFlags {
769 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
770}
771impl Default for EstimatorStatusFlags {
772 fn default() -> Self {
773 Self::DEFAULT
774 }
775}
776#[cfg_attr(feature = "ts", derive(TS))]
777#[cfg_attr(feature = "ts", ts(export))]
778#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
780#[cfg_attr(feature = "serde", serde(tag = "type"))]
781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
782#[repr(u32)]
783#[doc = "List of possible failure type to inject."]
784pub enum FailureType {
785 #[doc = "No failure injected, used to reset a previous failure."]
786 FAILURE_TYPE_OK = 0,
787 #[doc = "Sets unit off, so completely non-responsive."]
788 FAILURE_TYPE_OFF = 1,
789 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
790 FAILURE_TYPE_STUCK = 2,
791 #[doc = "Unit is reporting complete garbage."]
792 FAILURE_TYPE_GARBAGE = 3,
793 #[doc = "Unit is consistently wrong."]
794 FAILURE_TYPE_WRONG = 4,
795 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
796 FAILURE_TYPE_SLOW = 5,
797 #[doc = "Data of unit is delayed in time."]
798 FAILURE_TYPE_DELAYED = 6,
799 #[doc = "Unit is sometimes working, sometimes not."]
800 FAILURE_TYPE_INTERMITTENT = 7,
801}
802impl FailureType {
803 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
804}
805impl Default for FailureType {
806 fn default() -> Self {
807 Self::DEFAULT
808 }
809}
810#[cfg_attr(feature = "ts", derive(TS))]
811#[cfg_attr(feature = "ts", ts(export))]
812#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
814#[cfg_attr(feature = "serde", serde(tag = "type"))]
815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
816#[repr(u32)]
817#[doc = "List of possible units where failures can be injected."]
818pub enum FailureUnit {
819 FAILURE_UNIT_SENSOR_GYRO = 0,
820 FAILURE_UNIT_SENSOR_ACCEL = 1,
821 FAILURE_UNIT_SENSOR_MAG = 2,
822 FAILURE_UNIT_SENSOR_BARO = 3,
823 FAILURE_UNIT_SENSOR_GPS = 4,
824 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
825 FAILURE_UNIT_SENSOR_VIO = 6,
826 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
827 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
828 FAILURE_UNIT_SYSTEM_BATTERY = 100,
829 FAILURE_UNIT_SYSTEM_MOTOR = 101,
830 FAILURE_UNIT_SYSTEM_SERVO = 102,
831 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
832 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
833 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
834}
835impl FailureUnit {
836 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
837}
838impl Default for FailureUnit {
839 fn default() -> Self {
840 Self::DEFAULT
841 }
842}
843#[cfg_attr(feature = "ts", derive(TS))]
844#[cfg_attr(feature = "ts", ts(export))]
845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
847#[cfg_attr(feature = "serde", serde(tag = "type"))]
848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
849#[repr(u32)]
850pub enum FenceBreach {
851 #[doc = "No last fence breach"]
852 FENCE_BREACH_NONE = 0,
853 #[doc = "Breached minimum altitude"]
854 FENCE_BREACH_MINALT = 1,
855 #[doc = "Breached maximum altitude"]
856 FENCE_BREACH_MAXALT = 2,
857 #[doc = "Breached fence boundary"]
858 FENCE_BREACH_BOUNDARY = 3,
859}
860impl FenceBreach {
861 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
862}
863impl Default for FenceBreach {
864 fn default() -> Self {
865 Self::DEFAULT
866 }
867}
868#[cfg_attr(feature = "ts", derive(TS))]
869#[cfg_attr(feature = "ts", ts(export))]
870#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
872#[cfg_attr(feature = "serde", serde(tag = "type"))]
873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
874#[repr(u32)]
875#[doc = "Actions being taken to mitigate/prevent fence breach"]
876pub enum FenceMitigate {
877 #[doc = "Unknown"]
878 FENCE_MITIGATE_UNKNOWN = 0,
879 #[doc = "No actions being taken"]
880 FENCE_MITIGATE_NONE = 1,
881 #[doc = "Velocity limiting active to prevent breach"]
882 FENCE_MITIGATE_VEL_LIMIT = 2,
883}
884impl FenceMitigate {
885 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
886}
887impl Default for FenceMitigate {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892#[cfg_attr(feature = "ts", derive(TS))]
893#[cfg_attr(feature = "ts", ts(export))]
894#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
896#[cfg_attr(feature = "serde", serde(tag = "type"))]
897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
898#[repr(u32)]
899#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
900pub enum FenceType {
901 #[doc = "Maximum altitude fence"]
902 FENCE_TYPE_ALT_MAX = 1,
903 #[doc = "Circle fence"]
904 FENCE_TYPE_CIRCLE = 2,
905 #[doc = "Polygon fence"]
906 FENCE_TYPE_POLYGON = 4,
907 #[doc = "Minimum altitude fence"]
908 FENCE_TYPE_ALT_MIN = 8,
909}
910impl FenceType {
911 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
912}
913impl Default for FenceType {
914 fn default() -> Self {
915 Self::DEFAULT
916 }
917}
918#[cfg_attr(feature = "ts", derive(TS))]
919#[cfg_attr(feature = "ts", ts(export))]
920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
922#[cfg_attr(feature = "serde", serde(tag = "type"))]
923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
924#[repr(u32)]
925#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
926pub enum FirmwareVersionType {
927 #[doc = "development release"]
928 FIRMWARE_VERSION_TYPE_DEV = 0,
929 #[doc = "alpha release"]
930 FIRMWARE_VERSION_TYPE_ALPHA = 64,
931 #[doc = "beta release"]
932 FIRMWARE_VERSION_TYPE_BETA = 128,
933 #[doc = "release candidate"]
934 FIRMWARE_VERSION_TYPE_RC = 192,
935 #[doc = "official stable release"]
936 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
937}
938impl FirmwareVersionType {
939 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
940}
941impl Default for FirmwareVersionType {
942 fn default() -> Self {
943 Self::DEFAULT
944 }
945}
946bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
947impl GimbalDeviceCapFlags {
948 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
949}
950impl Default for GimbalDeviceCapFlags {
951 fn default() -> Self {
952 Self::DEFAULT
953 }
954}
955bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
956impl GimbalDeviceErrorFlags {
957 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
958}
959impl Default for GimbalDeviceErrorFlags {
960 fn default() -> Self {
961 Self::DEFAULT
962 }
963}
964bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
965impl GimbalDeviceFlags {
966 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
967}
968impl Default for GimbalDeviceFlags {
969 fn default() -> Self {
970 Self::DEFAULT
971 }
972}
973bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
974impl GimbalManagerCapFlags {
975 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
976}
977impl Default for GimbalManagerCapFlags {
978 fn default() -> Self {
979 Self::DEFAULT
980 }
981}
982bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
983impl GimbalManagerFlags {
984 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
985}
986impl Default for GimbalManagerFlags {
987 fn default() -> Self {
988 Self::DEFAULT
989 }
990}
991#[cfg_attr(feature = "ts", derive(TS))]
992#[cfg_attr(feature = "ts", ts(export))]
993#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
995#[cfg_attr(feature = "serde", serde(tag = "type"))]
996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
997#[repr(u32)]
998#[doc = "Type of GPS fix"]
999pub enum GpsFixType {
1000 #[doc = "No GPS connected"]
1001 GPS_FIX_TYPE_NO_GPS = 0,
1002 #[doc = "No position information, GPS is connected"]
1003 GPS_FIX_TYPE_NO_FIX = 1,
1004 #[doc = "2D position"]
1005 GPS_FIX_TYPE_2D_FIX = 2,
1006 #[doc = "3D position"]
1007 GPS_FIX_TYPE_3D_FIX = 3,
1008 #[doc = "DGPS/SBAS aided 3D position"]
1009 GPS_FIX_TYPE_DGPS = 4,
1010 #[doc = "RTK float, 3D position"]
1011 GPS_FIX_TYPE_RTK_FLOAT = 5,
1012 #[doc = "RTK Fixed, 3D position"]
1013 GPS_FIX_TYPE_RTK_FIXED = 6,
1014 #[doc = "Static fixed, typically used for base stations"]
1015 GPS_FIX_TYPE_STATIC = 7,
1016 #[doc = "PPP, 3D position."]
1017 GPS_FIX_TYPE_PPP = 8,
1018}
1019impl GpsFixType {
1020 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1021}
1022impl Default for GpsFixType {
1023 fn default() -> Self {
1024 Self::DEFAULT
1025 }
1026}
1027bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1028impl GpsInputIgnoreFlags {
1029 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1030}
1031impl Default for GpsInputIgnoreFlags {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036#[cfg_attr(feature = "ts", derive(TS))]
1037#[cfg_attr(feature = "ts", ts(export))]
1038#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1040#[cfg_attr(feature = "serde", serde(tag = "type"))]
1041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1042#[repr(u32)]
1043#[doc = "Gripper actions."]
1044pub enum GripperActions {
1045 #[doc = "Gripper release cargo."]
1046 GRIPPER_ACTION_RELEASE = 0,
1047 #[doc = "Gripper grab onto cargo."]
1048 GRIPPER_ACTION_GRAB = 1,
1049}
1050impl GripperActions {
1051 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1052}
1053impl Default for GripperActions {
1054 fn default() -> Self {
1055 Self::DEFAULT
1056 }
1057}
1058bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1059impl HighresImuUpdatedFlags {
1060 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1061}
1062impl Default for HighresImuUpdatedFlags {
1063 fn default() -> Self {
1064 Self::DEFAULT
1065 }
1066}
1067bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1068impl HilActuatorControlsFlags {
1069 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1070}
1071impl Default for HilActuatorControlsFlags {
1072 fn default() -> Self {
1073 Self::DEFAULT
1074 }
1075}
1076bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1077impl HilSensorUpdatedFlags {
1078 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1079}
1080impl Default for HilSensorUpdatedFlags {
1081 fn default() -> Self {
1082 Self::DEFAULT
1083 }
1084}
1085bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1086impl HlFailureFlag {
1087 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1088}
1089impl Default for HlFailureFlag {
1090 fn default() -> Self {
1091 Self::DEFAULT
1092 }
1093}
1094bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1095impl IlluminatorErrorFlags {
1096 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1097}
1098impl Default for IlluminatorErrorFlags {
1099 fn default() -> Self {
1100 Self::DEFAULT
1101 }
1102}
1103#[cfg_attr(feature = "ts", derive(TS))]
1104#[cfg_attr(feature = "ts", ts(export))]
1105#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1106#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1107#[cfg_attr(feature = "serde", serde(tag = "type"))]
1108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1109#[repr(u32)]
1110#[doc = "Modes of illuminator"]
1111pub enum IlluminatorMode {
1112 #[doc = "Illuminator mode is not specified/unknown"]
1113 ILLUMINATOR_MODE_UNKNOWN = 0,
1114 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1115 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1116 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1117 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1118}
1119impl IlluminatorMode {
1120 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1121}
1122impl Default for IlluminatorMode {
1123 fn default() -> Self {
1124 Self::DEFAULT
1125 }
1126}
1127#[cfg_attr(feature = "ts", derive(TS))]
1128#[cfg_attr(feature = "ts", ts(export))]
1129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1131#[cfg_attr(feature = "serde", serde(tag = "type"))]
1132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1133#[repr(u32)]
1134#[doc = "Type of landing target"]
1135pub enum LandingTargetType {
1136 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1137 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1138 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1139 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1140 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1141 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1142 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1143 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1144}
1145impl LandingTargetType {
1146 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1147}
1148impl Default for LandingTargetType {
1149 fn default() -> Self {
1150 Self::DEFAULT
1151 }
1152}
1153#[cfg_attr(feature = "ts", derive(TS))]
1154#[cfg_attr(feature = "ts", ts(export))]
1155#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1157#[cfg_attr(feature = "serde", serde(tag = "type"))]
1158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1159#[repr(u32)]
1160pub enum MagCalStatus {
1161 MAG_CAL_NOT_STARTED = 0,
1162 MAG_CAL_WAITING_TO_START = 1,
1163 MAG_CAL_RUNNING_STEP_ONE = 2,
1164 MAG_CAL_RUNNING_STEP_TWO = 3,
1165 MAG_CAL_SUCCESS = 4,
1166 MAG_CAL_FAILED = 5,
1167 MAG_CAL_BAD_ORIENTATION = 6,
1168 MAG_CAL_BAD_RADIUS = 7,
1169}
1170impl MagCalStatus {
1171 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1172}
1173impl Default for MagCalStatus {
1174 fn default() -> Self {
1175 Self::DEFAULT
1176 }
1177}
1178#[cfg_attr(feature = "ts", derive(TS))]
1179#[cfg_attr(feature = "ts", ts(export))]
1180#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1182#[cfg_attr(feature = "serde", serde(tag = "type"))]
1183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1184#[repr(u32)]
1185pub enum MavArmAuthDeniedReason {
1186 #[doc = "Not a specific reason"]
1187 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1188 #[doc = "Authorizer will send the error as string to GCS"]
1189 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1190 #[doc = "At least one waypoint have a invalid value"]
1191 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1192 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1193 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1194 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1195 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1196 #[doc = "Weather is not good to fly"]
1197 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1198}
1199impl MavArmAuthDeniedReason {
1200 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1201}
1202impl Default for MavArmAuthDeniedReason {
1203 fn default() -> Self {
1204 Self::DEFAULT
1205 }
1206}
1207#[cfg_attr(feature = "ts", derive(TS))]
1208#[cfg_attr(feature = "ts", ts(export))]
1209#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1211#[cfg_attr(feature = "serde", serde(tag = "type"))]
1212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1213#[repr(u32)]
1214#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1215pub enum MavAutopilot {
1216 #[doc = "Generic autopilot, full support for everything"]
1217 MAV_AUTOPILOT_GENERIC = 0,
1218 #[doc = "Reserved for future use."]
1219 MAV_AUTOPILOT_RESERVED = 1,
1220 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1221 MAV_AUTOPILOT_SLUGS = 2,
1222 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1223 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1224 #[doc = "OpenPilot, <http://openpilot.org>"]
1225 MAV_AUTOPILOT_OPENPILOT = 4,
1226 #[doc = "Generic autopilot only supporting simple waypoints"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1228 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1229 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1230 #[doc = "Generic autopilot supporting the full mission command set"]
1231 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1232 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1233 MAV_AUTOPILOT_INVALID = 8,
1234 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1235 MAV_AUTOPILOT_PPZ = 9,
1236 #[doc = "UAV Dev Board"]
1237 MAV_AUTOPILOT_UDB = 10,
1238 #[doc = "FlexiPilot"]
1239 MAV_AUTOPILOT_FP = 11,
1240 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1241 MAV_AUTOPILOT_PX4 = 12,
1242 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1243 MAV_AUTOPILOT_SMACCMPILOT = 13,
1244 #[doc = "AutoQuad -- <http://autoquad.org>"]
1245 MAV_AUTOPILOT_AUTOQUAD = 14,
1246 #[doc = "Armazila -- <http://armazila.com>"]
1247 MAV_AUTOPILOT_ARMAZILA = 15,
1248 #[doc = "Aerob -- <http://aerob.ru>"]
1249 MAV_AUTOPILOT_AEROB = 16,
1250 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1251 MAV_AUTOPILOT_ASLUAV = 17,
1252 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1253 MAV_AUTOPILOT_SMARTAP = 18,
1254 #[doc = "AirRails - <http://uaventure.com>"]
1255 MAV_AUTOPILOT_AIRRAILS = 19,
1256 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1257 MAV_AUTOPILOT_REFLEX = 20,
1258}
1259impl MavAutopilot {
1260 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1261}
1262impl Default for MavAutopilot {
1263 fn default() -> Self {
1264 Self::DEFAULT
1265 }
1266}
1267#[cfg_attr(feature = "ts", derive(TS))]
1268#[cfg_attr(feature = "ts", ts(export))]
1269#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1271#[cfg_attr(feature = "serde", serde(tag = "type"))]
1272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1273#[repr(u32)]
1274#[doc = "Enumeration for battery charge states."]
1275pub enum MavBatteryChargeState {
1276 #[doc = "Low battery state is not provided"]
1277 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1278 #[doc = "Battery is not in low state. Normal operation."]
1279 MAV_BATTERY_CHARGE_STATE_OK = 1,
1280 #[doc = "Battery state is low, warn and monitor close."]
1281 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1282 #[doc = "Battery state is critical, return or abort immediately."]
1283 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1284 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1285 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1286 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1288 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1289 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1290 #[doc = "Battery is charging."]
1291 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1292}
1293impl MavBatteryChargeState {
1294 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1295}
1296impl Default for MavBatteryChargeState {
1297 fn default() -> Self {
1298 Self::DEFAULT
1299 }
1300}
1301bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1302impl MavBatteryFault {
1303 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1304}
1305impl Default for MavBatteryFault {
1306 fn default() -> Self {
1307 Self::DEFAULT
1308 }
1309}
1310#[cfg_attr(feature = "ts", derive(TS))]
1311#[cfg_attr(feature = "ts", ts(export))]
1312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1314#[cfg_attr(feature = "serde", serde(tag = "type"))]
1315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1316#[repr(u32)]
1317#[doc = "Enumeration of battery functions"]
1318pub enum MavBatteryFunction {
1319 #[doc = "Battery function is unknown"]
1320 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1321 #[doc = "Battery supports all flight systems"]
1322 MAV_BATTERY_FUNCTION_ALL = 1,
1323 #[doc = "Battery for the propulsion system"]
1324 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1325 #[doc = "Avionics battery"]
1326 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1327 #[doc = "Payload battery"]
1328 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1329}
1330impl MavBatteryFunction {
1331 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1332}
1333impl Default for MavBatteryFunction {
1334 fn default() -> Self {
1335 Self::DEFAULT
1336 }
1337}
1338#[cfg_attr(feature = "ts", derive(TS))]
1339#[cfg_attr(feature = "ts", ts(export))]
1340#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1342#[cfg_attr(feature = "serde", serde(tag = "type"))]
1343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1344#[repr(u32)]
1345#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1346pub enum MavBatteryMode {
1347 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1348 MAV_BATTERY_MODE_UNKNOWN = 0,
1349 #[doc = "Battery is auto discharging (towards storage level)."]
1350 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1351 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1352 MAV_BATTERY_MODE_HOT_SWAP = 2,
1353}
1354impl MavBatteryMode {
1355 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1356}
1357impl Default for MavBatteryMode {
1358 fn default() -> Self {
1359 Self::DEFAULT
1360 }
1361}
1362#[cfg_attr(feature = "ts", derive(TS))]
1363#[cfg_attr(feature = "ts", ts(export))]
1364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1366#[cfg_attr(feature = "serde", serde(tag = "type"))]
1367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1368#[repr(u32)]
1369#[doc = "Enumeration of battery types"]
1370pub enum MavBatteryType {
1371 #[doc = "Not specified."]
1372 MAV_BATTERY_TYPE_UNKNOWN = 0,
1373 #[doc = "Lithium polymer battery"]
1374 MAV_BATTERY_TYPE_LIPO = 1,
1375 #[doc = "Lithium-iron-phosphate battery"]
1376 MAV_BATTERY_TYPE_LIFE = 2,
1377 #[doc = "Lithium-ION battery"]
1378 MAV_BATTERY_TYPE_LION = 3,
1379 #[doc = "Nickel metal hydride battery"]
1380 MAV_BATTERY_TYPE_NIMH = 4,
1381}
1382impl MavBatteryType {
1383 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1384}
1385impl Default for MavBatteryType {
1386 fn default() -> Self {
1387 Self::DEFAULT
1388 }
1389}
1390#[cfg_attr(feature = "ts", derive(TS))]
1391#[cfg_attr(feature = "ts", ts(export))]
1392#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1393#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1394#[cfg_attr(feature = "serde", serde(tag = "type"))]
1395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1396#[repr(u32)]
1397#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1398pub enum MavCmd {
1399 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1400 MAV_CMD_NAV_WAYPOINT = 16,
1401 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1402 MAV_CMD_NAV_LOITER_UNLIM = 17,
1403 #[doc = "Loiter around this waypoint for X turns"]
1404 MAV_CMD_NAV_LOITER_TURNS = 18,
1405 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1406 MAV_CMD_NAV_LOITER_TIME = 19,
1407 #[doc = "Return to launch location"]
1408 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1409 #[doc = "Land at location."]
1410 MAV_CMD_NAV_LAND = 21,
1411 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1412 MAV_CMD_NAV_TAKEOFF = 22,
1413 #[doc = "Land at local position (local frame only)"]
1414 MAV_CMD_NAV_LAND_LOCAL = 23,
1415 #[doc = "Takeoff from local position (local frame only)"]
1416 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1417 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1418 MAV_CMD_NAV_FOLLOW = 25,
1419 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1420 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1421 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1422 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1423 #[doc = "Begin following a target"]
1424 MAV_CMD_DO_FOLLOW = 32,
1425 #[doc = "Reposition the MAV after a follow target command has been sent"]
1426 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1427 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1428 MAV_CMD_DO_ORBIT = 34,
1429 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1430 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1431 MAV_CMD_NAV_ROI = 80,
1432 #[doc = "Control autonomous path planning on the MAV."]
1433 MAV_CMD_NAV_PATHPLANNING = 81,
1434 #[doc = "Navigate to waypoint using a spline path."]
1435 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1436 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1437 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1438 #[doc = "Land using VTOL mode"]
1439 MAV_CMD_NAV_VTOL_LAND = 85,
1440 #[doc = "hand control over to an external controller"]
1441 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1442 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1443 MAV_CMD_NAV_DELAY = 93,
1444 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1445 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1446 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1447 MAV_CMD_NAV_LAST = 95,
1448 #[doc = "Delay mission state machine."]
1449 MAV_CMD_CONDITION_DELAY = 112,
1450 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1451 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1452 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1453 MAV_CMD_CONDITION_DISTANCE = 114,
1454 #[doc = "Reach a certain target angle."]
1455 MAV_CMD_CONDITION_YAW = 115,
1456 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1457 MAV_CMD_CONDITION_LAST = 159,
1458 #[doc = "Set system mode."]
1459 MAV_CMD_DO_SET_MODE = 176,
1460 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1461 MAV_CMD_DO_JUMP = 177,
1462 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1463 MAV_CMD_DO_CHANGE_SPEED = 178,
1464 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1465 MAV_CMD_DO_SET_HOME = 179,
1466 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1467 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1468 MAV_CMD_DO_SET_PARAMETER = 180,
1469 #[doc = "Set a relay to a condition."]
1470 MAV_CMD_DO_SET_RELAY = 181,
1471 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1472 MAV_CMD_DO_REPEAT_RELAY = 182,
1473 #[doc = "Set a servo to a desired PWM value."]
1474 MAV_CMD_DO_SET_SERVO = 183,
1475 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1476 MAV_CMD_DO_REPEAT_SERVO = 184,
1477 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1478 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1479 #[doc = "Change altitude set point."]
1480 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1481 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1482 MAV_CMD_DO_SET_ACTUATOR = 187,
1483 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1484 MAV_CMD_DO_RETURN_PATH_START = 188,
1485 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1486 MAV_CMD_DO_LAND_START = 189,
1487 #[doc = "Mission command to perform a landing from a rally point."]
1488 MAV_CMD_DO_RALLY_LAND = 190,
1489 #[doc = "Mission command to safely abort an autonomous landing."]
1490 MAV_CMD_DO_GO_AROUND = 191,
1491 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1492 MAV_CMD_DO_REPOSITION = 192,
1493 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1494 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1495 #[doc = "Set moving direction to forward or reverse."]
1496 MAV_CMD_DO_SET_REVERSE = 194,
1497 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1499 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1500 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1501 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1502 MAV_CMD_DO_SET_ROI_NONE = 197,
1503 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1504 MAV_CMD_DO_SET_ROI_SYSID = 198,
1505 #[doc = "Control onboard camera system."]
1506 MAV_CMD_DO_CONTROL_VIDEO = 200,
1507 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1508 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1509 MAV_CMD_DO_SET_ROI = 201,
1510 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1512 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1513 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1514 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1515 #[doc = "Mission command to configure a camera or antenna mount"]
1516 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1517 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1518 #[doc = "Mission command to control a camera or antenna mount"]
1519 MAV_CMD_DO_MOUNT_CONTROL = 205,
1520 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1521 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1522 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1523 MAV_CMD_DO_FENCE_ENABLE = 207,
1524 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1525 MAV_CMD_DO_PARACHUTE = 208,
1526 #[doc = "Command to perform motor test."]
1527 MAV_CMD_DO_MOTOR_TEST = 209,
1528 #[doc = "Change to/from inverted flight."]
1529 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1530 #[doc = "Mission command to operate a gripper."]
1531 MAV_CMD_DO_GRIPPER = 211,
1532 #[doc = "Enable/disable autotune."]
1533 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1534 #[doc = "Sets a desired vehicle turn angle and speed change."]
1535 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1536 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1537 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1538 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1539 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1540 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1541 #[doc = "set id of master controller"]
1542 MAV_CMD_DO_GUIDED_MASTER = 221,
1543 #[doc = "Set limits for external control"]
1544 MAV_CMD_DO_GUIDED_LIMITS = 222,
1545 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1546 MAV_CMD_DO_ENGINE_CONTROL = 223,
1547 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1548 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1549 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1550 MAV_CMD_DO_LAST = 240,
1551 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1552 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1553 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1554 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1555 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1556 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1557 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1558 MAV_CMD_PREFLIGHT_STORAGE = 245,
1559 #[doc = "Request the reboot or shutdown of system components."]
1560 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1561 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1562 MAV_CMD_OVERRIDE_GOTO = 252,
1563 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1564 MAV_CMD_OBLIQUE_SURVEY = 260,
1565 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1566 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1567 #[doc = "start running a mission"]
1568 MAV_CMD_MISSION_START = 300,
1569 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1570 MAV_CMD_ACTUATOR_TEST = 310,
1571 #[doc = "Actuator configuration command."]
1572 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1573 #[doc = "Arms / Disarms a component"]
1574 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1575 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1576 MAV_CMD_RUN_PREARM_CHECKS = 401,
1577 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1579 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1580 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1581 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1582 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1583 MAV_CMD_GET_HOME_POSITION = 410,
1584 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1585 MAV_CMD_INJECT_FAILURE = 420,
1586 #[doc = "Starts receiver pairing."]
1587 MAV_CMD_START_RX_PAIR = 500,
1588 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1589 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1590 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1591 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1592 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1593 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1594 MAV_CMD_REQUEST_MESSAGE = 512,
1595 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1596 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1597 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1598 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1599 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1600 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1601 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1602 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1603 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1604 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1605 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1606 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1607 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1608 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1610 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1611 MAV_CMD_STORAGE_FORMAT = 526,
1612 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1613 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1614 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1615 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1616 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1617 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1618 #[doc = "Reset all camera settings to Factory Default"]
1619 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1620 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1621 MAV_CMD_SET_CAMERA_MODE = 530,
1622 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_ZOOM = 531,
1624 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1625 MAV_CMD_SET_CAMERA_FOCUS = 532,
1626 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1627 MAV_CMD_SET_STORAGE_USAGE = 533,
1628 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1629 MAV_CMD_SET_CAMERA_SOURCE = 534,
1630 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1631 MAV_CMD_JUMP_TAG = 600,
1632 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1633 MAV_CMD_DO_JUMP_TAG = 601,
1634 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1636 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1637 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1638 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1640 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1641 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1642 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1643 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1644 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1645 #[doc = "Enable or disable on-board camera triggering system."]
1646 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1647 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1649 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1650 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1651 #[doc = "Stops ongoing tracking."]
1652 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1653 #[doc = "Starts video capture (recording)."]
1654 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1655 #[doc = "Stop the current video capture (recording)."]
1656 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1657 #[doc = "Start video streaming"]
1658 MAV_CMD_VIDEO_START_STREAMING = 2502,
1659 #[doc = "Stop the given video stream"]
1660 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1661 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1662 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1663 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1664 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1665 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1666 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1667 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1668 MAV_CMD_LOGGING_START = 2510,
1669 #[doc = "Request to stop streaming log data over MAVLink"]
1670 MAV_CMD_LOGGING_STOP = 2511,
1671 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1672 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1673 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1674 #[doc = "Create a panorama at the current position"]
1675 MAV_CMD_PANORAMA_CREATE = 2800,
1676 #[doc = "Request VTOL transition"]
1677 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1678 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1679 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1680 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1682 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1683 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1684 #[doc = "Delay mission state machine until gate has been reached."]
1685 MAV_CMD_CONDITION_GATE = 4501,
1686 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1687 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1688 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1690 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1691 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1692 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1694 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1695 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1696 #[doc = "Rally point. You can have multiple rally points defined."]
1697 MAV_CMD_NAV_RALLY_POINT = 5100,
1698 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1699 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1700 #[doc = "Change state of safety switch."]
1701 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1702 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1703 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1704 #[deprecated = " (Deprecated since 2021-06)"]
1705 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1706 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1707 #[deprecated = " (Deprecated since 2021-06)"]
1708 #[doc = "Control the payload deployment."]
1709 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1710 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1711 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1712 #[doc = "Command to operate winch."]
1713 MAV_CMD_DO_WINCH = 42600,
1714 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1715 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_1 = 31000,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_2 = 31001,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_3 = 31002,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_4 = 31003,
1724 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1725 MAV_CMD_WAYPOINT_USER_5 = 31004,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_1 = 31005,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_2 = 31006,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_3 = 31007,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_4 = 31008,
1734 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1735 MAV_CMD_SPATIAL_USER_5 = 31009,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_1 = 31010,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_2 = 31011,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_3 = 31012,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_4 = 31013,
1744 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1745 MAV_CMD_USER_5 = 31014,
1746 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1747 MAV_CMD_CAN_FORWARD = 32000,
1748}
1749impl MavCmd {
1750 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1751}
1752impl Default for MavCmd {
1753 fn default() -> Self {
1754 Self::DEFAULT
1755 }
1756}
1757#[cfg_attr(feature = "ts", derive(TS))]
1758#[cfg_attr(feature = "ts", ts(export))]
1759#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1761#[cfg_attr(feature = "serde", serde(tag = "type"))]
1762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1763#[repr(u32)]
1764#[doc = "Possible actions an aircraft can take to avoid a collision."]
1765pub enum MavCollisionAction {
1766 #[doc = "Ignore any potential collisions"]
1767 MAV_COLLISION_ACTION_NONE = 0,
1768 #[doc = "Report potential collision"]
1769 MAV_COLLISION_ACTION_REPORT = 1,
1770 #[doc = "Ascend or Descend to avoid threat"]
1771 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1772 #[doc = "Move horizontally to avoid threat"]
1773 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1774 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1775 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1776 #[doc = "Aircraft to fly directly back to its launch point"]
1777 MAV_COLLISION_ACTION_RTL = 5,
1778 #[doc = "Aircraft to stop in place"]
1779 MAV_COLLISION_ACTION_HOVER = 6,
1780}
1781impl MavCollisionAction {
1782 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1783}
1784impl Default for MavCollisionAction {
1785 fn default() -> Self {
1786 Self::DEFAULT
1787 }
1788}
1789#[cfg_attr(feature = "ts", derive(TS))]
1790#[cfg_attr(feature = "ts", ts(export))]
1791#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1793#[cfg_attr(feature = "serde", serde(tag = "type"))]
1794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1795#[repr(u32)]
1796#[doc = "Source of information about this collision."]
1797pub enum MavCollisionSrc {
1798 #[doc = "ID field references ADSB_VEHICLE packets"]
1799 MAV_COLLISION_SRC_ADSB = 0,
1800 #[doc = "ID field references MAVLink SRC ID"]
1801 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1802}
1803impl MavCollisionSrc {
1804 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1805}
1806impl Default for MavCollisionSrc {
1807 fn default() -> Self {
1808 Self::DEFAULT
1809 }
1810}
1811#[cfg_attr(feature = "ts", derive(TS))]
1812#[cfg_attr(feature = "ts", ts(export))]
1813#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1815#[cfg_attr(feature = "serde", serde(tag = "type"))]
1816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1817#[repr(u32)]
1818#[doc = "Aircraft-rated danger from this threat."]
1819pub enum MavCollisionThreatLevel {
1820 #[doc = "Not a threat"]
1821 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1822 #[doc = "Craft is mildly concerned about this threat"]
1823 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1824 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1825 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1826}
1827impl MavCollisionThreatLevel {
1828 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1829}
1830impl Default for MavCollisionThreatLevel {
1831 fn default() -> Self {
1832 Self::DEFAULT
1833 }
1834}
1835#[cfg_attr(feature = "ts", derive(TS))]
1836#[cfg_attr(feature = "ts", ts(export))]
1837#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1839#[cfg_attr(feature = "serde", serde(tag = "type"))]
1840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1841#[repr(u32)]
1842#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1843pub enum MavComponent {
1844 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1845 MAV_COMP_ID_ALL = 0,
1846 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1847 MAV_COMP_ID_AUTOPILOT1 = 1,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER1 = 25,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER2 = 26,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER3 = 27,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER4 = 28,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER5 = 29,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER6 = 30,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER7 = 31,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER8 = 32,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER9 = 33,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER10 = 34,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER11 = 35,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER12 = 36,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER13 = 37,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER14 = 38,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER15 = 39,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER16 = 40,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER17 = 41,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER18 = 42,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER19 = 43,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER20 = 44,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER21 = 45,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER22 = 46,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER23 = 47,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER24 = 48,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER25 = 49,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER26 = 50,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER27 = 51,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER28 = 52,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER29 = 53,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER30 = 54,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER31 = 55,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER32 = 56,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER33 = 57,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER34 = 58,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER35 = 59,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER36 = 60,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER37 = 61,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER38 = 62,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER39 = 63,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER40 = 64,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER41 = 65,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER42 = 66,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER43 = 67,
1934 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1935 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER45 = 69,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER46 = 70,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER47 = 71,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER48 = 72,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER49 = 73,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER50 = 74,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER51 = 75,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER52 = 76,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER53 = 77,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER54 = 78,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER55 = 79,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER56 = 80,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER57 = 81,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER58 = 82,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER59 = 83,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER60 = 84,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER61 = 85,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER62 = 86,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER63 = 87,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER64 = 88,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER65 = 89,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER66 = 90,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER67 = 91,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER68 = 92,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER69 = 93,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER70 = 94,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER71 = 95,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER72 = 96,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER73 = 97,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER74 = 98,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER75 = 99,
1998 #[doc = "Camera #1."]
1999 MAV_COMP_ID_CAMERA = 100,
2000 #[doc = "Camera #2."]
2001 MAV_COMP_ID_CAMERA2 = 101,
2002 #[doc = "Camera #3."]
2003 MAV_COMP_ID_CAMERA3 = 102,
2004 #[doc = "Camera #4."]
2005 MAV_COMP_ID_CAMERA4 = 103,
2006 #[doc = "Camera #5."]
2007 MAV_COMP_ID_CAMERA5 = 104,
2008 #[doc = "Camera #6."]
2009 MAV_COMP_ID_CAMERA6 = 105,
2010 #[doc = "Servo #1."]
2011 MAV_COMP_ID_SERVO1 = 140,
2012 #[doc = "Servo #2."]
2013 MAV_COMP_ID_SERVO2 = 141,
2014 #[doc = "Servo #3."]
2015 MAV_COMP_ID_SERVO3 = 142,
2016 #[doc = "Servo #4."]
2017 MAV_COMP_ID_SERVO4 = 143,
2018 #[doc = "Servo #5."]
2019 MAV_COMP_ID_SERVO5 = 144,
2020 #[doc = "Servo #6."]
2021 MAV_COMP_ID_SERVO6 = 145,
2022 #[doc = "Servo #7."]
2023 MAV_COMP_ID_SERVO7 = 146,
2024 #[doc = "Servo #8."]
2025 MAV_COMP_ID_SERVO8 = 147,
2026 #[doc = "Servo #9."]
2027 MAV_COMP_ID_SERVO9 = 148,
2028 #[doc = "Servo #10."]
2029 MAV_COMP_ID_SERVO10 = 149,
2030 #[doc = "Servo #11."]
2031 MAV_COMP_ID_SERVO11 = 150,
2032 #[doc = "Servo #12."]
2033 MAV_COMP_ID_SERVO12 = 151,
2034 #[doc = "Servo #13."]
2035 MAV_COMP_ID_SERVO13 = 152,
2036 #[doc = "Servo #14."]
2037 MAV_COMP_ID_SERVO14 = 153,
2038 #[doc = "Gimbal #1."]
2039 MAV_COMP_ID_GIMBAL = 154,
2040 #[doc = "Logging component."]
2041 MAV_COMP_ID_LOG = 155,
2042 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2043 MAV_COMP_ID_ADSB = 156,
2044 #[doc = "On Screen Display (OSD) devices for video links."]
2045 MAV_COMP_ID_OSD = 157,
2046 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2047 MAV_COMP_ID_PERIPHERAL = 158,
2048 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2049 #[doc = "Gimbal ID for QX1."]
2050 MAV_COMP_ID_QX1_GIMBAL = 159,
2051 #[doc = "FLARM collision alert component."]
2052 MAV_COMP_ID_FLARM = 160,
2053 #[doc = "Parachute component."]
2054 MAV_COMP_ID_PARACHUTE = 161,
2055 #[doc = "Winch component."]
2056 MAV_COMP_ID_WINCH = 169,
2057 #[doc = "Gimbal #2."]
2058 MAV_COMP_ID_GIMBAL2 = 171,
2059 #[doc = "Gimbal #3."]
2060 MAV_COMP_ID_GIMBAL3 = 172,
2061 #[doc = "Gimbal #4"]
2062 MAV_COMP_ID_GIMBAL4 = 173,
2063 #[doc = "Gimbal #5."]
2064 MAV_COMP_ID_GIMBAL5 = 174,
2065 #[doc = "Gimbal #6."]
2066 MAV_COMP_ID_GIMBAL6 = 175,
2067 #[doc = "Battery #1."]
2068 MAV_COMP_ID_BATTERY = 180,
2069 #[doc = "Battery #2."]
2070 MAV_COMP_ID_BATTERY2 = 181,
2071 #[doc = "CAN over MAVLink client."]
2072 MAV_COMP_ID_MAVCAN = 189,
2073 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2074 MAV_COMP_ID_MISSIONPLANNER = 190,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2081 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2082 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2083 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2084 MAV_COMP_ID_PATHPLANNER = 195,
2085 #[doc = "Component that plans a collision free path between two points."]
2086 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2087 #[doc = "Component that provides position estimates using VIO techniques."]
2088 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2089 #[doc = "Component that manages pairing of vehicle and GCS."]
2090 MAV_COMP_ID_PAIRING_MANAGER = 198,
2091 #[doc = "Inertial Measurement Unit (IMU) #1."]
2092 MAV_COMP_ID_IMU = 200,
2093 #[doc = "Inertial Measurement Unit (IMU) #2."]
2094 MAV_COMP_ID_IMU_2 = 201,
2095 #[doc = "Inertial Measurement Unit (IMU) #3."]
2096 MAV_COMP_ID_IMU_3 = 202,
2097 #[doc = "GPS #1."]
2098 MAV_COMP_ID_GPS = 220,
2099 #[doc = "GPS #2."]
2100 MAV_COMP_ID_GPS2 = 221,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_1 = 236,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_2 = 237,
2105 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2106 MAV_COMP_ID_ODID_TXRX_3 = 238,
2107 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2108 MAV_COMP_ID_UDP_BRIDGE = 240,
2109 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2110 MAV_COMP_ID_UART_BRIDGE = 241,
2111 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2112 MAV_COMP_ID_TUNNEL_NODE = 242,
2113 #[doc = "Illuminator"]
2114 MAV_COMP_ID_ILLUMINATOR = 243,
2115 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2116 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2117 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2118}
2119impl MavComponent {
2120 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2121}
2122impl Default for MavComponent {
2123 fn default() -> Self {
2124 Self::DEFAULT
2125 }
2126}
2127#[cfg_attr(feature = "ts", derive(TS))]
2128#[cfg_attr(feature = "ts", ts(export))]
2129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2131#[cfg_attr(feature = "serde", serde(tag = "type"))]
2132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2133#[repr(u32)]
2134#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2135#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2136pub enum MavDataStream {
2137 #[doc = "Enable all data streams"]
2138 MAV_DATA_STREAM_ALL = 0,
2139 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2140 MAV_DATA_STREAM_RAW_SENSORS = 1,
2141 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2142 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2143 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2144 MAV_DATA_STREAM_RC_CHANNELS = 3,
2145 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2146 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2147 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2148 MAV_DATA_STREAM_POSITION = 6,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA1 = 10,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA2 = 11,
2153 #[doc = "Dependent on the autopilot"]
2154 MAV_DATA_STREAM_EXTRA3 = 12,
2155}
2156impl MavDataStream {
2157 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2158}
2159impl Default for MavDataStream {
2160 fn default() -> Self {
2161 Self::DEFAULT
2162 }
2163}
2164#[cfg_attr(feature = "ts", derive(TS))]
2165#[cfg_attr(feature = "ts", ts(export))]
2166#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2168#[cfg_attr(feature = "serde", serde(tag = "type"))]
2169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2170#[repr(u32)]
2171#[doc = "Enumeration of distance sensor types"]
2172pub enum MavDistanceSensor {
2173 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2174 MAV_DISTANCE_SENSOR_LASER = 0,
2175 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2176 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2177 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2178 MAV_DISTANCE_SENSOR_INFRARED = 2,
2179 #[doc = "Radar type, e.g. uLanding units"]
2180 MAV_DISTANCE_SENSOR_RADAR = 3,
2181 #[doc = "Broken or unknown type, e.g. analog units"]
2182 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2183}
2184impl MavDistanceSensor {
2185 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2186}
2187impl Default for MavDistanceSensor {
2188 fn default() -> Self {
2189 Self::DEFAULT
2190 }
2191}
2192#[cfg_attr(feature = "ts", derive(TS))]
2193#[cfg_attr(feature = "ts", ts(export))]
2194#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2196#[cfg_attr(feature = "serde", serde(tag = "type"))]
2197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2198#[repr(u32)]
2199#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2200pub enum MavDoRepositionFlags {
2201 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2202 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2203}
2204impl MavDoRepositionFlags {
2205 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2206}
2207impl Default for MavDoRepositionFlags {
2208 fn default() -> Self {
2209 Self::DEFAULT
2210 }
2211}
2212#[cfg_attr(feature = "ts", derive(TS))]
2213#[cfg_attr(feature = "ts", ts(export))]
2214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2216#[cfg_attr(feature = "serde", serde(tag = "type"))]
2217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2218#[repr(u32)]
2219#[doc = "Enumeration of estimator types"]
2220pub enum MavEstimatorType {
2221 #[doc = "Unknown type of the estimator."]
2222 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2223 #[doc = "This is a naive estimator without any real covariance feedback."]
2224 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2225 #[doc = "Computer vision based estimate. Might be up to scale."]
2226 MAV_ESTIMATOR_TYPE_VISION = 2,
2227 #[doc = "Visual-inertial estimate."]
2228 MAV_ESTIMATOR_TYPE_VIO = 3,
2229 #[doc = "Plain GPS estimate."]
2230 MAV_ESTIMATOR_TYPE_GPS = 4,
2231 #[doc = "Estimator integrating GPS and inertial sensing."]
2232 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2233 #[doc = "Estimate from external motion capturing system."]
2234 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2235 #[doc = "Estimator based on lidar sensor input."]
2236 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2237 #[doc = "Estimator on autopilot."]
2238 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2239}
2240impl MavEstimatorType {
2241 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2242}
2243impl Default for MavEstimatorType {
2244 fn default() -> Self {
2245 Self::DEFAULT
2246 }
2247}
2248#[cfg_attr(feature = "ts", derive(TS))]
2249#[cfg_attr(feature = "ts", ts(export))]
2250#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2252#[cfg_attr(feature = "serde", serde(tag = "type"))]
2253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2254#[repr(u32)]
2255#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2256pub enum MavEventCurrentSequenceFlags {
2257 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2258 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2259}
2260impl MavEventCurrentSequenceFlags {
2261 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2262}
2263impl Default for MavEventCurrentSequenceFlags {
2264 fn default() -> Self {
2265 Self::DEFAULT
2266 }
2267}
2268#[cfg_attr(feature = "ts", derive(TS))]
2269#[cfg_attr(feature = "ts", ts(export))]
2270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2272#[cfg_attr(feature = "serde", serde(tag = "type"))]
2273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2274#[repr(u32)]
2275#[doc = "Reason for an event error response."]
2276pub enum MavEventErrorReason {
2277 #[doc = "The requested event is not available (anymore)."]
2278 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2279}
2280impl MavEventErrorReason {
2281 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2282}
2283impl Default for MavEventErrorReason {
2284 fn default() -> Self {
2285 Self::DEFAULT
2286 }
2287}
2288#[cfg_attr(feature = "ts", derive(TS))]
2289#[cfg_attr(feature = "ts", ts(export))]
2290#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2292#[cfg_attr(feature = "serde", serde(tag = "type"))]
2293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2294#[repr(u32)]
2295#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2296pub enum MavFrame {
2297 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2298 MAV_FRAME_GLOBAL = 0,
2299 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2300 MAV_FRAME_LOCAL_NED = 1,
2301 #[doc = "NOT a coordinate frame, indicates a mission command."]
2302 MAV_FRAME_MISSION = 2,
2303 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2304 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2305 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2306 MAV_FRAME_LOCAL_ENU = 4,
2307 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2308 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2309 MAV_FRAME_GLOBAL_INT = 5,
2310 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2311 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2312 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2313 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2314 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2315 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2316 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2317 MAV_FRAME_BODY_NED = 8,
2318 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2319 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2320 MAV_FRAME_BODY_OFFSET_NED = 9,
2321 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2322 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2323 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2324 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2325 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2326 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2327 MAV_FRAME_BODY_FRD = 12,
2328 #[deprecated = " (Deprecated since 2019-04)"]
2329 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2330 MAV_FRAME_RESERVED_13 = 13,
2331 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2332 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2333 MAV_FRAME_RESERVED_14 = 14,
2334 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2335 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2336 MAV_FRAME_RESERVED_15 = 15,
2337 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2338 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2339 MAV_FRAME_RESERVED_16 = 16,
2340 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2341 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2342 MAV_FRAME_RESERVED_17 = 17,
2343 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2344 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2345 MAV_FRAME_RESERVED_18 = 18,
2346 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2347 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2348 MAV_FRAME_RESERVED_19 = 19,
2349 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FRD = 20,
2351 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2352 MAV_FRAME_LOCAL_FLU = 21,
2353}
2354impl MavFrame {
2355 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2356}
2357impl Default for MavFrame {
2358 fn default() -> Self {
2359 Self::DEFAULT
2360 }
2361}
2362#[cfg_attr(feature = "ts", derive(TS))]
2363#[cfg_attr(feature = "ts", ts(export))]
2364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2366#[cfg_attr(feature = "serde", serde(tag = "type"))]
2367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2368#[repr(u32)]
2369#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2370pub enum MavFtpErr {
2371 #[doc = "None: No error"]
2372 MAV_FTP_ERR_NONE = 0,
2373 #[doc = "Fail: Unknown failure"]
2374 MAV_FTP_ERR_FAIL = 1,
2375 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2376 MAV_FTP_ERR_FAILERRNO = 2,
2377 #[doc = "InvalidDataSize: Payload size is invalid"]
2378 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2379 #[doc = "InvalidSession: Session is not currently open"]
2380 MAV_FTP_ERR_INVALIDSESSION = 4,
2381 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2382 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2383 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2384 MAV_FTP_ERR_EOF = 6,
2385 #[doc = "UnknownCommand: Unknown command / opcode"]
2386 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2387 #[doc = "FileExists: File/directory already exists"]
2388 MAV_FTP_ERR_FILEEXISTS = 8,
2389 #[doc = "FileProtected: File/directory is write protected"]
2390 MAV_FTP_ERR_FILEPROTECTED = 9,
2391 #[doc = "FileNotFound: File/directory not found"]
2392 MAV_FTP_ERR_FILENOTFOUND = 10,
2393}
2394impl MavFtpErr {
2395 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2396}
2397impl Default for MavFtpErr {
2398 fn default() -> Self {
2399 Self::DEFAULT
2400 }
2401}
2402#[cfg_attr(feature = "ts", derive(TS))]
2403#[cfg_attr(feature = "ts", ts(export))]
2404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2406#[cfg_attr(feature = "serde", serde(tag = "type"))]
2407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2408#[repr(u32)]
2409#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2410pub enum MavFtpOpcode {
2411 #[doc = "None. Ignored, always ACKed"]
2412 MAV_FTP_OPCODE_NONE = 0,
2413 #[doc = "TerminateSession: Terminates open Read session"]
2414 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2415 #[doc = "ResetSessions: Terminates all open read sessions"]
2416 MAV_FTP_OPCODE_RESETSESSION = 2,
2417 #[doc = "ListDirectory. List files and directories in path from offset"]
2418 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2419 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2420 MAV_FTP_OPCODE_OPENFILERO = 4,
2421 #[doc = "ReadFile: Reads size bytes from offset in session"]
2422 MAV_FTP_OPCODE_READFILE = 5,
2423 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2424 MAV_FTP_OPCODE_CREATEFILE = 6,
2425 #[doc = "WriteFile: Writes size bytes to offset in session"]
2426 MAV_FTP_OPCODE_WRITEFILE = 7,
2427 #[doc = "RemoveFile: Remove file at path"]
2428 MAV_FTP_OPCODE_REMOVEFILE = 8,
2429 #[doc = "CreateDirectory: Creates directory at path"]
2430 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2431 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2432 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2433 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2434 MAV_FTP_OPCODE_OPENFILEWO = 11,
2435 #[doc = "TruncateFile: Truncate file at path to offset length"]
2436 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2437 #[doc = "Rename: Rename path1 to path2"]
2438 MAV_FTP_OPCODE_RENAME = 13,
2439 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2440 MAV_FTP_OPCODE_CALCFILECRC = 14,
2441 #[doc = "BurstReadFile: Burst download session file"]
2442 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2443 #[doc = "ACK: ACK response"]
2444 MAV_FTP_OPCODE_ACK = 128,
2445 #[doc = "NAK: NAK response"]
2446 MAV_FTP_OPCODE_NAK = 129,
2447}
2448impl MavFtpOpcode {
2449 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2450}
2451impl Default for MavFtpOpcode {
2452 fn default() -> Self {
2453 Self::DEFAULT
2454 }
2455}
2456#[cfg_attr(feature = "ts", derive(TS))]
2457#[cfg_attr(feature = "ts", ts(export))]
2458#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2460#[cfg_attr(feature = "serde", serde(tag = "type"))]
2461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2462#[repr(u32)]
2463#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2464pub enum MavFuelType {
2465 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2466 MAV_FUEL_TYPE_UNKNOWN = 0,
2467 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2468 MAV_FUEL_TYPE_LIQUID = 1,
2469 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2470 MAV_FUEL_TYPE_GAS = 2,
2471}
2472impl MavFuelType {
2473 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2474}
2475impl Default for MavFuelType {
2476 fn default() -> Self {
2477 Self::DEFAULT
2478 }
2479}
2480bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2481impl MavGeneratorStatusFlag {
2482 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2483}
2484impl Default for MavGeneratorStatusFlag {
2485 fn default() -> Self {
2486 Self::DEFAULT
2487 }
2488}
2489#[cfg_attr(feature = "ts", derive(TS))]
2490#[cfg_attr(feature = "ts", ts(export))]
2491#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2493#[cfg_attr(feature = "serde", serde(tag = "type"))]
2494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2495#[repr(u32)]
2496#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2497pub enum MavGoto {
2498 #[doc = "Hold at the current position."]
2499 MAV_GOTO_DO_HOLD = 0,
2500 #[doc = "Continue with the next item in mission execution."]
2501 MAV_GOTO_DO_CONTINUE = 1,
2502 #[doc = "Hold at the current position of the system"]
2503 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2504 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2505 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2506}
2507impl MavGoto {
2508 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2509}
2510impl Default for MavGoto {
2511 fn default() -> Self {
2512 Self::DEFAULT
2513 }
2514}
2515#[cfg_attr(feature = "ts", derive(TS))]
2516#[cfg_attr(feature = "ts", ts(export))]
2517#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2519#[cfg_attr(feature = "serde", serde(tag = "type"))]
2520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2521#[repr(u32)]
2522#[doc = "Enumeration of landed detector states"]
2523pub enum MavLandedState {
2524 #[doc = "MAV landed state is unknown"]
2525 MAV_LANDED_STATE_UNDEFINED = 0,
2526 #[doc = "MAV is landed (on ground)"]
2527 MAV_LANDED_STATE_ON_GROUND = 1,
2528 #[doc = "MAV is in air"]
2529 MAV_LANDED_STATE_IN_AIR = 2,
2530 #[doc = "MAV currently taking off"]
2531 MAV_LANDED_STATE_TAKEOFF = 3,
2532 #[doc = "MAV currently landing"]
2533 MAV_LANDED_STATE_LANDING = 4,
2534}
2535impl MavLandedState {
2536 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2537}
2538impl Default for MavLandedState {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543#[cfg_attr(feature = "ts", derive(TS))]
2544#[cfg_attr(feature = "ts", ts(export))]
2545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2547#[cfg_attr(feature = "serde", serde(tag = "type"))]
2548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2549#[repr(u32)]
2550#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2551pub enum MavMissionResult {
2552 #[doc = "mission accepted OK"]
2553 MAV_MISSION_ACCEPTED = 0,
2554 #[doc = "Generic error / not accepting mission commands at all right now."]
2555 MAV_MISSION_ERROR = 1,
2556 #[doc = "Coordinate frame is not supported."]
2557 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2558 #[doc = "Command is not supported."]
2559 MAV_MISSION_UNSUPPORTED = 3,
2560 #[doc = "Mission items exceed storage space."]
2561 MAV_MISSION_NO_SPACE = 4,
2562 #[doc = "One of the parameters has an invalid value."]
2563 MAV_MISSION_INVALID = 5,
2564 #[doc = "param1 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM1 = 6,
2566 #[doc = "param2 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM2 = 7,
2568 #[doc = "param3 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM3 = 8,
2570 #[doc = "param4 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM4 = 9,
2572 #[doc = "x / param5 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM5_X = 10,
2574 #[doc = "y / param6 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM6_Y = 11,
2576 #[doc = "z / param7 has an invalid value."]
2577 MAV_MISSION_INVALID_PARAM7 = 12,
2578 #[doc = "Mission item received out of sequence"]
2579 MAV_MISSION_INVALID_SEQUENCE = 13,
2580 #[doc = "Not accepting any mission commands from this communication partner."]
2581 MAV_MISSION_DENIED = 14,
2582 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2583 MAV_MISSION_OPERATION_CANCELLED = 15,
2584}
2585impl MavMissionResult {
2586 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2587}
2588impl Default for MavMissionResult {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[cfg_attr(feature = "ts", derive(TS))]
2594#[cfg_attr(feature = "ts", ts(export))]
2595#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2597#[cfg_attr(feature = "serde", serde(tag = "type"))]
2598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2599#[repr(u32)]
2600#[doc = "Type of mission items being requested/sent in mission protocol."]
2601pub enum MavMissionType {
2602 #[doc = "Items are mission commands for main mission."]
2603 MAV_MISSION_TYPE_MISSION = 0,
2604 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2605 MAV_MISSION_TYPE_FENCE = 1,
2606 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2607 MAV_MISSION_TYPE_RALLY = 2,
2608 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2609 MAV_MISSION_TYPE_ALL = 255,
2610}
2611impl MavMissionType {
2612 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2613}
2614impl Default for MavMissionType {
2615 fn default() -> Self {
2616 Self::DEFAULT
2617 }
2618}
2619#[cfg_attr(feature = "ts", derive(TS))]
2620#[cfg_attr(feature = "ts", ts(export))]
2621#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2623#[cfg_attr(feature = "serde", serde(tag = "type"))]
2624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2625#[repr(u32)]
2626#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2627pub enum MavMode {
2628 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2629 MAV_MODE_PREFLIGHT = 0,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_DISARMED = 80,
2632 #[doc = "System is allowed to be active, under assisted RC control."]
2633 MAV_MODE_STABILIZE_ARMED = 208,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_DISARMED = 64,
2636 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2637 MAV_MODE_MANUAL_ARMED = 192,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_DISARMED = 88,
2640 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2641 MAV_MODE_GUIDED_ARMED = 216,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_DISARMED = 92,
2644 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2645 MAV_MODE_AUTO_ARMED = 220,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_DISARMED = 66,
2648 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2649 MAV_MODE_TEST_ARMED = 194,
2650}
2651impl MavMode {
2652 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2653}
2654impl Default for MavMode {
2655 fn default() -> Self {
2656 Self::DEFAULT
2657 }
2658}
2659bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2660impl MavModeFlag {
2661 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2662}
2663impl Default for MavModeFlag {
2664 fn default() -> Self {
2665 Self::DEFAULT
2666 }
2667}
2668#[cfg_attr(feature = "ts", derive(TS))]
2669#[cfg_attr(feature = "ts", ts(export))]
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2676pub enum MavModeFlagDecodePosition {
2677 #[doc = "First bit: 10000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2679 #[doc = "Second bit: 01000000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2681 #[doc = "Third bit: 00100000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2683 #[doc = "Fourth bit: 00010000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2685 #[doc = "Fifth bit: 00001000"]
2686 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2687 #[doc = "Sixth bit: 00000100"]
2688 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2689 #[doc = "Seventh bit: 00000010"]
2690 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2691 #[doc = "Eighth bit: 00000001"]
2692 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2693}
2694impl MavModeFlagDecodePosition {
2695 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2696}
2697impl Default for MavModeFlagDecodePosition {
2698 fn default() -> Self {
2699 Self::DEFAULT
2700 }
2701}
2702bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2703impl MavModeProperty {
2704 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2705}
2706impl Default for MavModeProperty {
2707 fn default() -> Self {
2708 Self::DEFAULT
2709 }
2710}
2711#[cfg_attr(feature = "ts", derive(TS))]
2712#[cfg_attr(feature = "ts", ts(export))]
2713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2715#[cfg_attr(feature = "serde", serde(tag = "type"))]
2716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2717#[repr(u32)]
2718#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2719#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2720pub enum MavMountMode {
2721 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2722 MAV_MOUNT_MODE_RETRACT = 0,
2723 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2724 MAV_MOUNT_MODE_NEUTRAL = 1,
2725 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2727 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2728 MAV_MOUNT_MODE_RC_TARGETING = 3,
2729 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2730 MAV_MOUNT_MODE_GPS_POINT = 4,
2731 #[doc = "Gimbal tracks system with specified system ID"]
2732 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2733 #[doc = "Gimbal tracks home position"]
2734 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2735}
2736impl MavMountMode {
2737 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2738}
2739impl Default for MavMountMode {
2740 fn default() -> Self {
2741 Self::DEFAULT
2742 }
2743}
2744#[cfg_attr(feature = "ts", derive(TS))]
2745#[cfg_attr(feature = "ts", ts(export))]
2746#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2748#[cfg_attr(feature = "serde", serde(tag = "type"))]
2749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2750#[repr(u32)]
2751pub enum MavOdidArmStatus {
2752 #[doc = "Passing arming checks."]
2753 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2754 #[doc = "Generic arming failure, see error string for details."]
2755 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2756}
2757impl MavOdidArmStatus {
2758 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2759}
2760impl Default for MavOdidArmStatus {
2761 fn default() -> Self {
2762 Self::DEFAULT
2763 }
2764}
2765#[cfg_attr(feature = "ts", derive(TS))]
2766#[cfg_attr(feature = "ts", ts(export))]
2767#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2769#[cfg_attr(feature = "serde", serde(tag = "type"))]
2770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2771#[repr(u32)]
2772pub enum MavOdidAuthType {
2773 #[doc = "No authentication type is specified."]
2774 MAV_ODID_AUTH_TYPE_NONE = 0,
2775 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2776 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2777 #[doc = "Signature for the Operator ID."]
2778 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2779 #[doc = "Signature for the entire message set."]
2780 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2781 #[doc = "Authentication is provided by Network Remote ID."]
2782 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2783 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2784 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2785}
2786impl MavOdidAuthType {
2787 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2788}
2789impl Default for MavOdidAuthType {
2790 fn default() -> Self {
2791 Self::DEFAULT
2792 }
2793}
2794#[cfg_attr(feature = "ts", derive(TS))]
2795#[cfg_attr(feature = "ts", ts(export))]
2796#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2798#[cfg_attr(feature = "serde", serde(tag = "type"))]
2799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2800#[repr(u32)]
2801pub enum MavOdidCategoryEu {
2802 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2803 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2804 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2805 MAV_ODID_CATEGORY_EU_OPEN = 1,
2806 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2807 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2808 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2809 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2810}
2811impl MavOdidCategoryEu {
2812 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2813}
2814impl Default for MavOdidCategoryEu {
2815 fn default() -> Self {
2816 Self::DEFAULT
2817 }
2818}
2819#[cfg_attr(feature = "ts", derive(TS))]
2820#[cfg_attr(feature = "ts", ts(export))]
2821#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2823#[cfg_attr(feature = "serde", serde(tag = "type"))]
2824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2825#[repr(u32)]
2826pub enum MavOdidClassEu {
2827 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2828 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2830 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2832 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2834 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2836 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2838 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2840 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2841 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2842 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2843}
2844impl MavOdidClassEu {
2845 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2846}
2847impl Default for MavOdidClassEu {
2848 fn default() -> Self {
2849 Self::DEFAULT
2850 }
2851}
2852#[cfg_attr(feature = "ts", derive(TS))]
2853#[cfg_attr(feature = "ts", ts(export))]
2854#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2856#[cfg_attr(feature = "serde", serde(tag = "type"))]
2857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2858#[repr(u32)]
2859pub enum MavOdidClassificationType {
2860 #[doc = "The classification type for the UA is undeclared."]
2861 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2862 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2863 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2864}
2865impl MavOdidClassificationType {
2866 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2867}
2868impl Default for MavOdidClassificationType {
2869 fn default() -> Self {
2870 Self::DEFAULT
2871 }
2872}
2873#[cfg_attr(feature = "ts", derive(TS))]
2874#[cfg_attr(feature = "ts", ts(export))]
2875#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2877#[cfg_attr(feature = "serde", serde(tag = "type"))]
2878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2879#[repr(u32)]
2880pub enum MavOdidDescType {
2881 #[doc = "Optional free-form text description of the purpose of the flight."]
2882 MAV_ODID_DESC_TYPE_TEXT = 0,
2883 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2885 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2886 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2887}
2888impl MavOdidDescType {
2889 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2890}
2891impl Default for MavOdidDescType {
2892 fn default() -> Self {
2893 Self::DEFAULT
2894 }
2895}
2896#[cfg_attr(feature = "ts", derive(TS))]
2897#[cfg_attr(feature = "ts", ts(export))]
2898#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2900#[cfg_attr(feature = "serde", serde(tag = "type"))]
2901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2902#[repr(u32)]
2903pub enum MavOdidHeightRef {
2904 #[doc = "The height field is relative to the take-off location."]
2905 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2906 #[doc = "The height field is relative to ground."]
2907 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2908}
2909impl MavOdidHeightRef {
2910 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2911}
2912impl Default for MavOdidHeightRef {
2913 fn default() -> Self {
2914 Self::DEFAULT
2915 }
2916}
2917#[cfg_attr(feature = "ts", derive(TS))]
2918#[cfg_attr(feature = "ts", ts(export))]
2919#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2921#[cfg_attr(feature = "serde", serde(tag = "type"))]
2922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2923#[repr(u32)]
2924pub enum MavOdidHorAcc {
2925 #[doc = "The horizontal accuracy is unknown."]
2926 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2927 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2928 MAV_ODID_HOR_ACC_10NM = 1,
2929 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2930 MAV_ODID_HOR_ACC_4NM = 2,
2931 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2932 MAV_ODID_HOR_ACC_2NM = 3,
2933 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2934 MAV_ODID_HOR_ACC_1NM = 4,
2935 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2936 MAV_ODID_HOR_ACC_0_5NM = 5,
2937 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2938 MAV_ODID_HOR_ACC_0_3NM = 6,
2939 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2940 MAV_ODID_HOR_ACC_0_1NM = 7,
2941 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2942 MAV_ODID_HOR_ACC_0_05NM = 8,
2943 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2944 MAV_ODID_HOR_ACC_30_METER = 9,
2945 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2946 MAV_ODID_HOR_ACC_10_METER = 10,
2947 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2948 MAV_ODID_HOR_ACC_3_METER = 11,
2949 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2950 MAV_ODID_HOR_ACC_1_METER = 12,
2951}
2952impl MavOdidHorAcc {
2953 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2954}
2955impl Default for MavOdidHorAcc {
2956 fn default() -> Self {
2957 Self::DEFAULT
2958 }
2959}
2960#[cfg_attr(feature = "ts", derive(TS))]
2961#[cfg_attr(feature = "ts", ts(export))]
2962#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2964#[cfg_attr(feature = "serde", serde(tag = "type"))]
2965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2966#[repr(u32)]
2967pub enum MavOdidIdType {
2968 #[doc = "No type defined."]
2969 MAV_ODID_ID_TYPE_NONE = 0,
2970 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2971 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2972 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2973 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2974 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2975 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2976 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2977 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2978}
2979impl MavOdidIdType {
2980 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2981}
2982impl Default for MavOdidIdType {
2983 fn default() -> Self {
2984 Self::DEFAULT
2985 }
2986}
2987#[cfg_attr(feature = "ts", derive(TS))]
2988#[cfg_attr(feature = "ts", ts(export))]
2989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2991#[cfg_attr(feature = "serde", serde(tag = "type"))]
2992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2993#[repr(u32)]
2994pub enum MavOdidOperatorIdType {
2995 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2996 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2997}
2998impl MavOdidOperatorIdType {
2999 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3000}
3001impl Default for MavOdidOperatorIdType {
3002 fn default() -> Self {
3003 Self::DEFAULT
3004 }
3005}
3006#[cfg_attr(feature = "ts", derive(TS))]
3007#[cfg_attr(feature = "ts", ts(export))]
3008#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3010#[cfg_attr(feature = "serde", serde(tag = "type"))]
3011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3012#[repr(u32)]
3013pub enum MavOdidOperatorLocationType {
3014 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3016 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3018 #[doc = "The location/altitude of the operator are fixed values."]
3019 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3020}
3021impl MavOdidOperatorLocationType {
3022 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3023}
3024impl Default for MavOdidOperatorLocationType {
3025 fn default() -> Self {
3026 Self::DEFAULT
3027 }
3028}
3029#[cfg_attr(feature = "ts", derive(TS))]
3030#[cfg_attr(feature = "ts", ts(export))]
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidSpeedAcc {
3037 #[doc = "The speed accuracy is unknown."]
3038 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3039 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3040 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3041 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3042 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3043 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3044 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3045 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3046 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3047}
3048impl MavOdidSpeedAcc {
3049 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3050}
3051impl Default for MavOdidSpeedAcc {
3052 fn default() -> Self {
3053 Self::DEFAULT
3054 }
3055}
3056#[cfg_attr(feature = "ts", derive(TS))]
3057#[cfg_attr(feature = "ts", ts(export))]
3058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3060#[cfg_attr(feature = "serde", serde(tag = "type"))]
3061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3062#[repr(u32)]
3063pub enum MavOdidStatus {
3064 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3065 MAV_ODID_STATUS_UNDECLARED = 0,
3066 #[doc = "The UA is on the ground."]
3067 MAV_ODID_STATUS_GROUND = 1,
3068 #[doc = "The UA is in the air."]
3069 MAV_ODID_STATUS_AIRBORNE = 2,
3070 #[doc = "The UA is having an emergency."]
3071 MAV_ODID_STATUS_EMERGENCY = 3,
3072 #[doc = "The remote ID system is failing or unreliable in some way."]
3073 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3074}
3075impl MavOdidStatus {
3076 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3077}
3078impl Default for MavOdidStatus {
3079 fn default() -> Self {
3080 Self::DEFAULT
3081 }
3082}
3083#[cfg_attr(feature = "ts", derive(TS))]
3084#[cfg_attr(feature = "ts", ts(export))]
3085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3087#[cfg_attr(feature = "serde", serde(tag = "type"))]
3088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3089#[repr(u32)]
3090pub enum MavOdidTimeAcc {
3091 #[doc = "The timestamp accuracy is unknown."]
3092 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3094 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3096 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3098 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3100 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3102 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3104 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3106 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3108 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3110 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3112 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3114 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3116 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3118 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3120 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3121 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3122 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3123}
3124impl MavOdidTimeAcc {
3125 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3126}
3127impl Default for MavOdidTimeAcc {
3128 fn default() -> Self {
3129 Self::DEFAULT
3130 }
3131}
3132#[cfg_attr(feature = "ts", derive(TS))]
3133#[cfg_attr(feature = "ts", ts(export))]
3134#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3136#[cfg_attr(feature = "serde", serde(tag = "type"))]
3137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3138#[repr(u32)]
3139pub enum MavOdidUaType {
3140 #[doc = "No UA (Unmanned Aircraft) type defined."]
3141 MAV_ODID_UA_TYPE_NONE = 0,
3142 #[doc = "Aeroplane/Airplane. Fixed wing."]
3143 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3144 #[doc = "Helicopter or multirotor."]
3145 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3146 #[doc = "Gyroplane."]
3147 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3148 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3149 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3150 #[doc = "Ornithopter."]
3151 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3152 #[doc = "Glider."]
3153 MAV_ODID_UA_TYPE_GLIDER = 6,
3154 #[doc = "Kite."]
3155 MAV_ODID_UA_TYPE_KITE = 7,
3156 #[doc = "Free Balloon."]
3157 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3158 #[doc = "Captive Balloon."]
3159 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3160 #[doc = "Airship. E.g. a blimp."]
3161 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3162 #[doc = "Free Fall/Parachute (unpowered)."]
3163 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3164 #[doc = "Rocket."]
3165 MAV_ODID_UA_TYPE_ROCKET = 12,
3166 #[doc = "Tethered powered aircraft."]
3167 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3168 #[doc = "Ground Obstacle."]
3169 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3170 #[doc = "Other type of aircraft not listed earlier."]
3171 MAV_ODID_UA_TYPE_OTHER = 15,
3172}
3173impl MavOdidUaType {
3174 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3175}
3176impl Default for MavOdidUaType {
3177 fn default() -> Self {
3178 Self::DEFAULT
3179 }
3180}
3181#[cfg_attr(feature = "ts", derive(TS))]
3182#[cfg_attr(feature = "ts", ts(export))]
3183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3185#[cfg_attr(feature = "serde", serde(tag = "type"))]
3186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3187#[repr(u32)]
3188pub enum MavOdidVerAcc {
3189 #[doc = "The vertical accuracy is unknown."]
3190 MAV_ODID_VER_ACC_UNKNOWN = 0,
3191 #[doc = "The vertical accuracy is smaller than 150 meter."]
3192 MAV_ODID_VER_ACC_150_METER = 1,
3193 #[doc = "The vertical accuracy is smaller than 45 meter."]
3194 MAV_ODID_VER_ACC_45_METER = 2,
3195 #[doc = "The vertical accuracy is smaller than 25 meter."]
3196 MAV_ODID_VER_ACC_25_METER = 3,
3197 #[doc = "The vertical accuracy is smaller than 10 meter."]
3198 MAV_ODID_VER_ACC_10_METER = 4,
3199 #[doc = "The vertical accuracy is smaller than 3 meter."]
3200 MAV_ODID_VER_ACC_3_METER = 5,
3201 #[doc = "The vertical accuracy is smaller than 1 meter."]
3202 MAV_ODID_VER_ACC_1_METER = 6,
3203}
3204impl MavOdidVerAcc {
3205 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3206}
3207impl Default for MavOdidVerAcc {
3208 fn default() -> Self {
3209 Self::DEFAULT
3210 }
3211}
3212#[cfg_attr(feature = "ts", derive(TS))]
3213#[cfg_attr(feature = "ts", ts(export))]
3214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3216#[cfg_attr(feature = "serde", serde(tag = "type"))]
3217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3218#[repr(u32)]
3219#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3220pub enum MavParamExtType {
3221 #[doc = "8-bit unsigned integer"]
3222 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3223 #[doc = "8-bit signed integer"]
3224 MAV_PARAM_EXT_TYPE_INT8 = 2,
3225 #[doc = "16-bit unsigned integer"]
3226 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3227 #[doc = "16-bit signed integer"]
3228 MAV_PARAM_EXT_TYPE_INT16 = 4,
3229 #[doc = "32-bit unsigned integer"]
3230 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3231 #[doc = "32-bit signed integer"]
3232 MAV_PARAM_EXT_TYPE_INT32 = 6,
3233 #[doc = "64-bit unsigned integer"]
3234 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3235 #[doc = "64-bit signed integer"]
3236 MAV_PARAM_EXT_TYPE_INT64 = 8,
3237 #[doc = "32-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3239 #[doc = "64-bit floating-point"]
3240 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3241 #[doc = "Custom Type"]
3242 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3243}
3244impl MavParamExtType {
3245 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3246}
3247impl Default for MavParamExtType {
3248 fn default() -> Self {
3249 Self::DEFAULT
3250 }
3251}
3252#[cfg_attr(feature = "ts", derive(TS))]
3253#[cfg_attr(feature = "ts", ts(export))]
3254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3256#[cfg_attr(feature = "serde", serde(tag = "type"))]
3257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3258#[repr(u32)]
3259#[doc = "Specifies the datatype of a MAVLink parameter."]
3260pub enum MavParamType {
3261 #[doc = "8-bit unsigned integer"]
3262 MAV_PARAM_TYPE_UINT8 = 1,
3263 #[doc = "8-bit signed integer"]
3264 MAV_PARAM_TYPE_INT8 = 2,
3265 #[doc = "16-bit unsigned integer"]
3266 MAV_PARAM_TYPE_UINT16 = 3,
3267 #[doc = "16-bit signed integer"]
3268 MAV_PARAM_TYPE_INT16 = 4,
3269 #[doc = "32-bit unsigned integer"]
3270 MAV_PARAM_TYPE_UINT32 = 5,
3271 #[doc = "32-bit signed integer"]
3272 MAV_PARAM_TYPE_INT32 = 6,
3273 #[doc = "64-bit unsigned integer"]
3274 MAV_PARAM_TYPE_UINT64 = 7,
3275 #[doc = "64-bit signed integer"]
3276 MAV_PARAM_TYPE_INT64 = 8,
3277 #[doc = "32-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL32 = 9,
3279 #[doc = "64-bit floating-point"]
3280 MAV_PARAM_TYPE_REAL64 = 10,
3281}
3282impl MavParamType {
3283 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3284}
3285impl Default for MavParamType {
3286 fn default() -> Self {
3287 Self::DEFAULT
3288 }
3289}
3290bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3291impl MavPowerStatus {
3292 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3293}
3294impl Default for MavPowerStatus {
3295 fn default() -> Self {
3296 Self::DEFAULT
3297 }
3298}
3299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3300impl MavProtocolCapability {
3301 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3302}
3303impl Default for MavProtocolCapability {
3304 fn default() -> Self {
3305 Self::DEFAULT
3306 }
3307}
3308#[cfg_attr(feature = "ts", derive(TS))]
3309#[cfg_attr(feature = "ts", ts(export))]
3310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3312#[cfg_attr(feature = "serde", serde(tag = "type"))]
3313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3314#[repr(u32)]
3315#[doc = "Result from a MAVLink command (MAV_CMD)"]
3316pub enum MavResult {
3317 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3318 MAV_RESULT_ACCEPTED = 0,
3319 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3320 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3321 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3322 MAV_RESULT_DENIED = 2,
3323 #[doc = "Command is not supported (unknown)."]
3324 MAV_RESULT_UNSUPPORTED = 3,
3325 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3326 MAV_RESULT_FAILED = 4,
3327 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3328 MAV_RESULT_IN_PROGRESS = 5,
3329 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3330 MAV_RESULT_CANCELLED = 6,
3331 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3332 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3333 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3334 MAV_RESULT_COMMAND_INT_ONLY = 8,
3335 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3336 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3337}
3338impl MavResult {
3339 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3340}
3341impl Default for MavResult {
3342 fn default() -> Self {
3343 Self::DEFAULT
3344 }
3345}
3346#[cfg_attr(feature = "ts", derive(TS))]
3347#[cfg_attr(feature = "ts", ts(export))]
3348#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3350#[cfg_attr(feature = "serde", serde(tag = "type"))]
3351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3352#[repr(u32)]
3353#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3354#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3355pub enum MavRoi {
3356 #[doc = "No region of interest."]
3357 MAV_ROI_NONE = 0,
3358 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3359 MAV_ROI_WPNEXT = 1,
3360 #[doc = "Point toward given waypoint."]
3361 MAV_ROI_WPINDEX = 2,
3362 #[doc = "Point toward fixed location."]
3363 MAV_ROI_LOCATION = 3,
3364 #[doc = "Point toward of given id."]
3365 MAV_ROI_TARGET = 4,
3366}
3367impl MavRoi {
3368 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3369}
3370impl Default for MavRoi {
3371 fn default() -> Self {
3372 Self::DEFAULT
3373 }
3374}
3375#[cfg_attr(feature = "ts", derive(TS))]
3376#[cfg_attr(feature = "ts", ts(export))]
3377#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3379#[cfg_attr(feature = "serde", serde(tag = "type"))]
3380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3381#[repr(u32)]
3382#[doc = "Enumeration of sensor orientation, according to its rotations"]
3383pub enum MavSensorOrientation {
3384 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3385 MAV_SENSOR_ROTATION_NONE = 0,
3386 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3387 MAV_SENSOR_ROTATION_YAW_45 = 1,
3388 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3389 MAV_SENSOR_ROTATION_YAW_90 = 2,
3390 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3391 MAV_SENSOR_ROTATION_YAW_135 = 3,
3392 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3393 MAV_SENSOR_ROTATION_YAW_180 = 4,
3394 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3395 MAV_SENSOR_ROTATION_YAW_225 = 5,
3396 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3397 MAV_SENSOR_ROTATION_YAW_270 = 6,
3398 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3399 MAV_SENSOR_ROTATION_YAW_315 = 7,
3400 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3401 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3402 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3403 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3404 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3405 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3406 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3407 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3408 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3409 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3410 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3411 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3412 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3413 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3414 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3415 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3416 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3417 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3418 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3419 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3420 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3421 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3422 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3423 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3424 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3425 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3426 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3427 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3428 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3429 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3430 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3431 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3432 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3434 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3435 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3436 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3437 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3438 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3439 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3440 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3442 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3443 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3444 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3445 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3446 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3447 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3448 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3450 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3451 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3452 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3454 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3455 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3456 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3457 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3458 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3459 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3460 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3461 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3462 #[doc = "Pitch: 315"]
3463 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3464 #[doc = "Roll: 90, Pitch: 315"]
3465 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3466 #[doc = "Custom orientation"]
3467 MAV_SENSOR_ROTATION_CUSTOM = 100,
3468}
3469impl MavSensorOrientation {
3470 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3471}
3472impl Default for MavSensorOrientation {
3473 fn default() -> Self {
3474 Self::DEFAULT
3475 }
3476}
3477#[cfg_attr(feature = "ts", derive(TS))]
3478#[cfg_attr(feature = "ts", ts(export))]
3479#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3481#[cfg_attr(feature = "serde", serde(tag = "type"))]
3482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3483#[repr(u32)]
3484#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3485pub enum MavSeverity {
3486 #[doc = "System is unusable. This is a \"panic\" condition."]
3487 MAV_SEVERITY_EMERGENCY = 0,
3488 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3489 MAV_SEVERITY_ALERT = 1,
3490 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3491 MAV_SEVERITY_CRITICAL = 2,
3492 #[doc = "Indicates an error in secondary/redundant systems."]
3493 MAV_SEVERITY_ERROR = 3,
3494 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3495 MAV_SEVERITY_WARNING = 4,
3496 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3497 MAV_SEVERITY_NOTICE = 5,
3498 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3499 MAV_SEVERITY_INFO = 6,
3500 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3501 MAV_SEVERITY_DEBUG = 7,
3502}
3503impl MavSeverity {
3504 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3505}
3506impl Default for MavSeverity {
3507 fn default() -> Self {
3508 Self::DEFAULT
3509 }
3510}
3511#[cfg_attr(feature = "ts", derive(TS))]
3512#[cfg_attr(feature = "ts", ts(export))]
3513#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3515#[cfg_attr(feature = "serde", serde(tag = "type"))]
3516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3517#[repr(u32)]
3518#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3519pub enum MavStandardMode {
3520 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3521 MAV_STANDARD_MODE_NON_STANDARD = 0,
3522 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3523 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3524 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3525 MAV_STANDARD_MODE_ORBIT = 2,
3526 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3527 MAV_STANDARD_MODE_CRUISE = 3,
3528 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3529 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3530 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3531 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3532 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3533 MAV_STANDARD_MODE_MISSION = 6,
3534 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3535 MAV_STANDARD_MODE_LAND = 7,
3536 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3537 MAV_STANDARD_MODE_TAKEOFF = 8,
3538}
3539impl MavStandardMode {
3540 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3541}
3542impl Default for MavStandardMode {
3543 fn default() -> Self {
3544 Self::DEFAULT
3545 }
3546}
3547#[cfg_attr(feature = "ts", derive(TS))]
3548#[cfg_attr(feature = "ts", ts(export))]
3549#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3551#[cfg_attr(feature = "serde", serde(tag = "type"))]
3552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3553#[repr(u32)]
3554pub enum MavState {
3555 #[doc = "Uninitialized system, state is unknown."]
3556 MAV_STATE_UNINIT = 0,
3557 #[doc = "System is booting up."]
3558 MAV_STATE_BOOT = 1,
3559 #[doc = "System is calibrating and not flight-ready."]
3560 MAV_STATE_CALIBRATING = 2,
3561 #[doc = "System is grounded and on standby. It can be launched any time."]
3562 MAV_STATE_STANDBY = 3,
3563 #[doc = "System is active and might be already airborne. Motors are engaged."]
3564 MAV_STATE_ACTIVE = 4,
3565 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3566 MAV_STATE_CRITICAL = 5,
3567 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3568 MAV_STATE_EMERGENCY = 6,
3569 #[doc = "System just initialized its power-down sequence, will shut down now."]
3570 MAV_STATE_POWEROFF = 7,
3571 #[doc = "System is terminating itself (failsafe or commanded)."]
3572 MAV_STATE_FLIGHT_TERMINATION = 8,
3573}
3574impl MavState {
3575 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3576}
3577impl Default for MavState {
3578 fn default() -> Self {
3579 Self::DEFAULT
3580 }
3581}
3582bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3583impl MavSysStatusSensor {
3584 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3585}
3586impl Default for MavSysStatusSensor {
3587 fn default() -> Self {
3588 Self::DEFAULT
3589 }
3590}
3591bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3592impl MavSysStatusSensorExtended {
3593 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3594}
3595impl Default for MavSysStatusSensorExtended {
3596 fn default() -> Self {
3597 Self::DEFAULT
3598 }
3599}
3600#[cfg_attr(feature = "ts", derive(TS))]
3601#[cfg_attr(feature = "ts", ts(export))]
3602#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3604#[cfg_attr(feature = "serde", serde(tag = "type"))]
3605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3606#[repr(u32)]
3607pub enum MavTunnelPayloadType {
3608 #[doc = "Encoding of payload unknown."]
3609 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3610 #[doc = "Registered for STorM32 gimbal controller."]
3611 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3612 #[doc = "Registered for STorM32 gimbal controller."]
3613 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3614 #[doc = "Registered for STorM32 gimbal controller."]
3615 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3616 #[doc = "Registered for STorM32 gimbal controller."]
3617 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3618 #[doc = "Registered for STorM32 gimbal controller."]
3619 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3620 #[doc = "Registered for STorM32 gimbal controller."]
3621 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3622 #[doc = "Registered for STorM32 gimbal controller."]
3623 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3624 #[doc = "Registered for STorM32 gimbal controller."]
3625 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3626 #[doc = "Registered for STorM32 gimbal controller."]
3627 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3628 #[doc = "Registered for STorM32 gimbal controller."]
3629 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3630 #[doc = "Registered for ModalAI remote OSD protocol."]
3631 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3632 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3633 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3634 #[doc = "Registered for ModalAI vendor use."]
3635 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3636}
3637impl MavTunnelPayloadType {
3638 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3639}
3640impl Default for MavTunnelPayloadType {
3641 fn default() -> Self {
3642 Self::DEFAULT
3643 }
3644}
3645#[cfg_attr(feature = "ts", derive(TS))]
3646#[cfg_attr(feature = "ts", ts(export))]
3647#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3649#[cfg_attr(feature = "serde", serde(tag = "type"))]
3650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3651#[repr(u32)]
3652#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3653pub enum MavType {
3654 #[doc = "Generic micro air vehicle"]
3655 MAV_TYPE_GENERIC = 0,
3656 #[doc = "Fixed wing aircraft."]
3657 MAV_TYPE_FIXED_WING = 1,
3658 #[doc = "Quadrotor"]
3659 MAV_TYPE_QUADROTOR = 2,
3660 #[doc = "Coaxial helicopter"]
3661 MAV_TYPE_COAXIAL = 3,
3662 #[doc = "Normal helicopter with tail rotor."]
3663 MAV_TYPE_HELICOPTER = 4,
3664 #[doc = "Ground installation"]
3665 MAV_TYPE_ANTENNA_TRACKER = 5,
3666 #[doc = "Operator control unit / ground control station"]
3667 MAV_TYPE_GCS = 6,
3668 #[doc = "Airship, controlled"]
3669 MAV_TYPE_AIRSHIP = 7,
3670 #[doc = "Free balloon, uncontrolled"]
3671 MAV_TYPE_FREE_BALLOON = 8,
3672 #[doc = "Rocket"]
3673 MAV_TYPE_ROCKET = 9,
3674 #[doc = "Ground rover"]
3675 MAV_TYPE_GROUND_ROVER = 10,
3676 #[doc = "Surface vessel, boat, ship"]
3677 MAV_TYPE_SURFACE_BOAT = 11,
3678 #[doc = "Submarine"]
3679 MAV_TYPE_SUBMARINE = 12,
3680 #[doc = "Hexarotor"]
3681 MAV_TYPE_HEXAROTOR = 13,
3682 #[doc = "Octorotor"]
3683 MAV_TYPE_OCTOROTOR = 14,
3684 #[doc = "Tricopter"]
3685 MAV_TYPE_TRICOPTER = 15,
3686 #[doc = "Flapping wing"]
3687 MAV_TYPE_FLAPPING_WING = 16,
3688 #[doc = "Kite"]
3689 MAV_TYPE_KITE = 17,
3690 #[doc = "Onboard companion controller"]
3691 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3692 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3693 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3694 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3695 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3696 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3697 MAV_TYPE_VTOL_TILTROTOR = 21,
3698 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3699 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3700 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3701 MAV_TYPE_VTOL_TAILSITTER = 23,
3702 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3703 MAV_TYPE_VTOL_TILTWING = 24,
3704 #[doc = "VTOL reserved 5"]
3705 MAV_TYPE_VTOL_RESERVED5 = 25,
3706 #[doc = "Gimbal"]
3707 MAV_TYPE_GIMBAL = 26,
3708 #[doc = "ADSB system"]
3709 MAV_TYPE_ADSB = 27,
3710 #[doc = "Steerable, nonrigid airfoil"]
3711 MAV_TYPE_PARAFOIL = 28,
3712 #[doc = "Dodecarotor"]
3713 MAV_TYPE_DODECAROTOR = 29,
3714 #[doc = "Camera"]
3715 MAV_TYPE_CAMERA = 30,
3716 #[doc = "Charging station"]
3717 MAV_TYPE_CHARGING_STATION = 31,
3718 #[doc = "FLARM collision avoidance system"]
3719 MAV_TYPE_FLARM = 32,
3720 #[doc = "Servo"]
3721 MAV_TYPE_SERVO = 33,
3722 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3723 MAV_TYPE_ODID = 34,
3724 #[doc = "Decarotor"]
3725 MAV_TYPE_DECAROTOR = 35,
3726 #[doc = "Battery"]
3727 MAV_TYPE_BATTERY = 36,
3728 #[doc = "Parachute"]
3729 MAV_TYPE_PARACHUTE = 37,
3730 #[doc = "Log"]
3731 MAV_TYPE_LOG = 38,
3732 #[doc = "OSD"]
3733 MAV_TYPE_OSD = 39,
3734 #[doc = "IMU"]
3735 MAV_TYPE_IMU = 40,
3736 #[doc = "GPS"]
3737 MAV_TYPE_GPS = 41,
3738 #[doc = "Winch"]
3739 MAV_TYPE_WINCH = 42,
3740 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3741 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3742 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3743 MAV_TYPE_ILLUMINATOR = 44,
3744 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3745 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3746}
3747impl MavType {
3748 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3749}
3750impl Default for MavType {
3751 fn default() -> Self {
3752 Self::DEFAULT
3753 }
3754}
3755#[cfg_attr(feature = "ts", derive(TS))]
3756#[cfg_attr(feature = "ts", ts(export))]
3757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3759#[cfg_attr(feature = "serde", serde(tag = "type"))]
3760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3761#[repr(u32)]
3762#[doc = "Enumeration of VTOL states"]
3763pub enum MavVtolState {
3764 #[doc = "MAV is not configured as VTOL"]
3765 MAV_VTOL_STATE_UNDEFINED = 0,
3766 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3767 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3768 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3769 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3770 #[doc = "VTOL is in multicopter state"]
3771 MAV_VTOL_STATE_MC = 3,
3772 #[doc = "VTOL is in fixed-wing state"]
3773 MAV_VTOL_STATE_FW = 4,
3774}
3775impl MavVtolState {
3776 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3777}
3778impl Default for MavVtolState {
3779 fn default() -> Self {
3780 Self::DEFAULT
3781 }
3782}
3783bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3784impl MavWinchStatusFlag {
3785 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3786}
3787impl Default for MavWinchStatusFlag {
3788 fn default() -> Self {
3789 Self::DEFAULT
3790 }
3791}
3792#[cfg_attr(feature = "ts", derive(TS))]
3793#[cfg_attr(feature = "ts", ts(export))]
3794#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3796#[cfg_attr(feature = "serde", serde(tag = "type"))]
3797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3798#[repr(u32)]
3799pub enum MavlinkDataStreamType {
3800 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3801 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3802 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3803 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3804 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3805 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3806}
3807impl MavlinkDataStreamType {
3808 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3809}
3810impl Default for MavlinkDataStreamType {
3811 fn default() -> Self {
3812 Self::DEFAULT
3813 }
3814}
3815#[cfg_attr(feature = "ts", derive(TS))]
3816#[cfg_attr(feature = "ts", ts(export))]
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3823pub enum MissionState {
3824 #[doc = "The mission status reporting is not supported."]
3825 MISSION_STATE_UNKNOWN = 0,
3826 #[doc = "No mission on the vehicle."]
3827 MISSION_STATE_NO_MISSION = 1,
3828 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3829 MISSION_STATE_NOT_STARTED = 2,
3830 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3831 MISSION_STATE_ACTIVE = 3,
3832 #[doc = "Mission is paused when in auto mode."]
3833 MISSION_STATE_PAUSED = 4,
3834 #[doc = "Mission has executed all mission items."]
3835 MISSION_STATE_COMPLETE = 5,
3836}
3837impl MissionState {
3838 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3839}
3840impl Default for MissionState {
3841 fn default() -> Self {
3842 Self::DEFAULT
3843 }
3844}
3845#[cfg_attr(feature = "ts", derive(TS))]
3846#[cfg_attr(feature = "ts", ts(export))]
3847#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3849#[cfg_attr(feature = "serde", serde(tag = "type"))]
3850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3851#[repr(u32)]
3852#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3853pub enum MotorTestOrder {
3854 #[doc = "Default autopilot motor test method."]
3855 MOTOR_TEST_ORDER_DEFAULT = 0,
3856 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3857 MOTOR_TEST_ORDER_SEQUENCE = 1,
3858 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3859 MOTOR_TEST_ORDER_BOARD = 2,
3860}
3861impl MotorTestOrder {
3862 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3863}
3864impl Default for MotorTestOrder {
3865 fn default() -> Self {
3866 Self::DEFAULT
3867 }
3868}
3869#[cfg_attr(feature = "ts", derive(TS))]
3870#[cfg_attr(feature = "ts", ts(export))]
3871#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3873#[cfg_attr(feature = "serde", serde(tag = "type"))]
3874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3875#[repr(u32)]
3876#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3877pub enum MotorTestThrottleType {
3878 #[doc = "Throttle as a percentage (0 ~ 100)"]
3879 MOTOR_TEST_THROTTLE_PERCENT = 0,
3880 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3881 MOTOR_TEST_THROTTLE_PWM = 1,
3882 #[doc = "Throttle pass-through from pilot's transmitter."]
3883 MOTOR_TEST_THROTTLE_PILOT = 2,
3884 #[doc = "Per-motor compass calibration test."]
3885 MOTOR_TEST_COMPASS_CAL = 3,
3886}
3887impl MotorTestThrottleType {
3888 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3889}
3890impl Default for MotorTestThrottleType {
3891 fn default() -> Self {
3892 Self::DEFAULT
3893 }
3894}
3895#[cfg_attr(feature = "ts", derive(TS))]
3896#[cfg_attr(feature = "ts", ts(export))]
3897#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3899#[cfg_attr(feature = "serde", serde(tag = "type"))]
3900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3901#[repr(u32)]
3902pub enum NavVtolLandOptions {
3903 #[doc = "Default autopilot landing behaviour."]
3904 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3905 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3906 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3907 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3908 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3909}
3910impl NavVtolLandOptions {
3911 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3912}
3913impl Default for NavVtolLandOptions {
3914 fn default() -> Self {
3915 Self::DEFAULT
3916 }
3917}
3918#[cfg_attr(feature = "ts", derive(TS))]
3919#[cfg_attr(feature = "ts", ts(export))]
3920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3922#[cfg_attr(feature = "serde", serde(tag = "type"))]
3923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3924#[repr(u32)]
3925#[doc = "Yaw behaviour during orbit flight."]
3926pub enum OrbitYawBehaviour {
3927 #[doc = "Vehicle front points to the center (default)."]
3928 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3929 #[doc = "Vehicle front holds heading when message received."]
3930 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3931 #[doc = "Yaw uncontrolled."]
3932 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3933 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3934 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3935 #[doc = "Yaw controlled by RC input."]
3936 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3937 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3938 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3939}
3940impl OrbitYawBehaviour {
3941 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3942}
3943impl Default for OrbitYawBehaviour {
3944 fn default() -> Self {
3945 Self::DEFAULT
3946 }
3947}
3948#[cfg_attr(feature = "ts", derive(TS))]
3949#[cfg_attr(feature = "ts", ts(export))]
3950#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3952#[cfg_attr(feature = "serde", serde(tag = "type"))]
3953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3954#[repr(u32)]
3955#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3956pub enum ParachuteAction {
3957 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3958 PARACHUTE_DISABLE = 0,
3959 #[doc = "Enable auto-release of parachute."]
3960 PARACHUTE_ENABLE = 1,
3961 #[doc = "Release parachute and kill motors."]
3962 PARACHUTE_RELEASE = 2,
3963}
3964impl ParachuteAction {
3965 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3966}
3967impl Default for ParachuteAction {
3968 fn default() -> Self {
3969 Self::DEFAULT
3970 }
3971}
3972#[cfg_attr(feature = "ts", derive(TS))]
3973#[cfg_attr(feature = "ts", ts(export))]
3974#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3976#[cfg_attr(feature = "serde", serde(tag = "type"))]
3977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3978#[repr(u32)]
3979#[doc = "Result from PARAM_EXT_SET message."]
3980pub enum ParamAck {
3981 #[doc = "Parameter value ACCEPTED and SET"]
3982 PARAM_ACK_ACCEPTED = 0,
3983 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3984 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3985 #[doc = "Parameter failed to set"]
3986 PARAM_ACK_FAILED = 2,
3987 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3988 PARAM_ACK_IN_PROGRESS = 3,
3989}
3990impl ParamAck {
3991 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3992}
3993impl Default for ParamAck {
3994 fn default() -> Self {
3995 Self::DEFAULT
3996 }
3997}
3998bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3999impl PositionTargetTypemask {
4000 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4001}
4002impl Default for PositionTargetTypemask {
4003 fn default() -> Self {
4004 Self::DEFAULT
4005 }
4006}
4007#[cfg_attr(feature = "ts", derive(TS))]
4008#[cfg_attr(feature = "ts", ts(export))]
4009#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4011#[cfg_attr(feature = "serde", serde(tag = "type"))]
4012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4013#[repr(u32)]
4014#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4015pub enum PrecisionLandMode {
4016 #[doc = "Normal (non-precision) landing."]
4017 PRECISION_LAND_MODE_DISABLED = 0,
4018 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4019 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4020 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4021 PRECISION_LAND_MODE_REQUIRED = 2,
4022}
4023impl PrecisionLandMode {
4024 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4025}
4026impl Default for PrecisionLandMode {
4027 fn default() -> Self {
4028 Self::DEFAULT
4029 }
4030}
4031#[cfg_attr(feature = "ts", derive(TS))]
4032#[cfg_attr(feature = "ts", ts(export))]
4033#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4035#[cfg_attr(feature = "serde", serde(tag = "type"))]
4036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4037#[repr(u32)]
4038#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4039pub enum PreflightStorageMissionAction {
4040 #[doc = "Read current mission data from persistent storage"]
4041 MISSION_READ_PERSISTENT = 0,
4042 #[doc = "Write current mission data to persistent storage"]
4043 MISSION_WRITE_PERSISTENT = 1,
4044 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4045 MISSION_RESET_DEFAULT = 2,
4046}
4047impl PreflightStorageMissionAction {
4048 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4049}
4050impl Default for PreflightStorageMissionAction {
4051 fn default() -> Self {
4052 Self::DEFAULT
4053 }
4054}
4055#[cfg_attr(feature = "ts", derive(TS))]
4056#[cfg_attr(feature = "ts", ts(export))]
4057#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4059#[cfg_attr(feature = "serde", serde(tag = "type"))]
4060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4061#[repr(u32)]
4062#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4063pub enum PreflightStorageParameterAction {
4064 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4065 PARAM_READ_PERSISTENT = 0,
4066 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4067 PARAM_WRITE_PERSISTENT = 1,
4068 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4069 PARAM_RESET_CONFIG_DEFAULT = 2,
4070 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4071 PARAM_RESET_SENSOR_DEFAULT = 3,
4072 #[doc = "Reset all parameters, including operation counters, to default values"]
4073 PARAM_RESET_ALL_DEFAULT = 4,
4074}
4075impl PreflightStorageParameterAction {
4076 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4077}
4078impl Default for PreflightStorageParameterAction {
4079 fn default() -> Self {
4080 Self::DEFAULT
4081 }
4082}
4083#[cfg_attr(feature = "ts", derive(TS))]
4084#[cfg_attr(feature = "ts", ts(export))]
4085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4087#[cfg_attr(feature = "serde", serde(tag = "type"))]
4088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4089#[repr(u32)]
4090#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4091pub enum RcSubType {
4092 #[doc = "Spektrum DSM2"]
4093 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4094 #[doc = "Spektrum DSMX"]
4095 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4096 #[doc = "Spektrum DSMX8"]
4097 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4098}
4099impl RcSubType {
4100 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4101}
4102impl Default for RcSubType {
4103 fn default() -> Self {
4104 Self::DEFAULT
4105 }
4106}
4107#[cfg_attr(feature = "ts", derive(TS))]
4108#[cfg_attr(feature = "ts", ts(export))]
4109#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4111#[cfg_attr(feature = "serde", serde(tag = "type"))]
4112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4113#[repr(u32)]
4114#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4115pub enum RcType {
4116 #[doc = "Spektrum"]
4117 RC_TYPE_SPEKTRUM = 0,
4118 #[doc = "CRSF"]
4119 RC_TYPE_CRSF = 1,
4120}
4121impl RcType {
4122 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4123}
4124impl Default for RcType {
4125 fn default() -> Self {
4126 Self::DEFAULT
4127 }
4128}
4129#[cfg_attr(feature = "ts", derive(TS))]
4130#[cfg_attr(feature = "ts", ts(export))]
4131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4133#[cfg_attr(feature = "serde", serde(tag = "type"))]
4134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4135#[repr(u32)]
4136#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4137pub enum RebootShutdownConditions {
4138 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4139 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4140 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4141 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4142}
4143impl RebootShutdownConditions {
4144 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4145}
4146impl Default for RebootShutdownConditions {
4147 fn default() -> Self {
4148 Self::DEFAULT
4149 }
4150}
4151#[cfg_attr(feature = "ts", derive(TS))]
4152#[cfg_attr(feature = "ts", ts(export))]
4153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4155#[cfg_attr(feature = "serde", serde(tag = "type"))]
4156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4157#[repr(u32)]
4158#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4159pub enum RtkBaselineCoordinateSystem {
4160 #[doc = "Earth-centered, Earth-fixed"]
4161 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4162 #[doc = "RTK basestation centered, north, east, down"]
4163 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4164}
4165impl RtkBaselineCoordinateSystem {
4166 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4167}
4168impl Default for RtkBaselineCoordinateSystem {
4169 fn default() -> Self {
4170 Self::DEFAULT
4171 }
4172}
4173#[cfg_attr(feature = "ts", derive(TS))]
4174#[cfg_attr(feature = "ts", ts(export))]
4175#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4177#[cfg_attr(feature = "serde", serde(tag = "type"))]
4178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4179#[repr(u32)]
4180#[doc = "Possible safety switch states."]
4181pub enum SafetySwitchState {
4182 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4183 SAFETY_SWITCH_STATE_SAFE = 0,
4184 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4185 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4186}
4187impl SafetySwitchState {
4188 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4189}
4190impl Default for SafetySwitchState {
4191 fn default() -> Self {
4192 Self::DEFAULT
4193 }
4194}
4195#[cfg_attr(feature = "ts", derive(TS))]
4196#[cfg_attr(feature = "ts", ts(export))]
4197#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4199#[cfg_attr(feature = "serde", serde(tag = "type"))]
4200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4201#[repr(u32)]
4202#[doc = "SERIAL_CONTROL device types"]
4203pub enum SerialControlDev {
4204 #[doc = "First telemetry port"]
4205 SERIAL_CONTROL_DEV_TELEM1 = 0,
4206 #[doc = "Second telemetry port"]
4207 SERIAL_CONTROL_DEV_TELEM2 = 1,
4208 #[doc = "First GPS port"]
4209 SERIAL_CONTROL_DEV_GPS1 = 2,
4210 #[doc = "Second GPS port"]
4211 SERIAL_CONTROL_DEV_GPS2 = 3,
4212 #[doc = "system shell"]
4213 SERIAL_CONTROL_DEV_SHELL = 10,
4214 #[doc = "SERIAL0"]
4215 SERIAL_CONTROL_SERIAL0 = 100,
4216 #[doc = "SERIAL1"]
4217 SERIAL_CONTROL_SERIAL1 = 101,
4218 #[doc = "SERIAL2"]
4219 SERIAL_CONTROL_SERIAL2 = 102,
4220 #[doc = "SERIAL3"]
4221 SERIAL_CONTROL_SERIAL3 = 103,
4222 #[doc = "SERIAL4"]
4223 SERIAL_CONTROL_SERIAL4 = 104,
4224 #[doc = "SERIAL5"]
4225 SERIAL_CONTROL_SERIAL5 = 105,
4226 #[doc = "SERIAL6"]
4227 SERIAL_CONTROL_SERIAL6 = 106,
4228 #[doc = "SERIAL7"]
4229 SERIAL_CONTROL_SERIAL7 = 107,
4230 #[doc = "SERIAL8"]
4231 SERIAL_CONTROL_SERIAL8 = 108,
4232 #[doc = "SERIAL9"]
4233 SERIAL_CONTROL_SERIAL9 = 109,
4234}
4235impl SerialControlDev {
4236 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4237}
4238impl Default for SerialControlDev {
4239 fn default() -> Self {
4240 Self::DEFAULT
4241 }
4242}
4243bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4244impl SerialControlFlag {
4245 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4246}
4247impl Default for SerialControlFlag {
4248 fn default() -> Self {
4249 Self::DEFAULT
4250 }
4251}
4252#[cfg_attr(feature = "ts", derive(TS))]
4253#[cfg_attr(feature = "ts", ts(export))]
4254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4256#[cfg_attr(feature = "serde", serde(tag = "type"))]
4257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4258#[repr(u32)]
4259#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4260pub enum SetFocusType {
4261 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4262 FOCUS_TYPE_STEP = 0,
4263 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4264 FOCUS_TYPE_CONTINUOUS = 1,
4265 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4266 FOCUS_TYPE_RANGE = 2,
4267 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4268 FOCUS_TYPE_METERS = 3,
4269 #[doc = "Focus automatically."]
4270 FOCUS_TYPE_AUTO = 4,
4271 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4272 FOCUS_TYPE_AUTO_SINGLE = 5,
4273 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4274 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4275}
4276impl SetFocusType {
4277 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4278}
4279impl Default for SetFocusType {
4280 fn default() -> Self {
4281 Self::DEFAULT
4282 }
4283}
4284#[cfg_attr(feature = "ts", derive(TS))]
4285#[cfg_attr(feature = "ts", ts(export))]
4286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4288#[cfg_attr(feature = "serde", serde(tag = "type"))]
4289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4290#[repr(u32)]
4291#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4292pub enum SpeedType {
4293 #[doc = "Airspeed"]
4294 SPEED_TYPE_AIRSPEED = 0,
4295 #[doc = "Groundspeed"]
4296 SPEED_TYPE_GROUNDSPEED = 1,
4297 #[doc = "Climb speed"]
4298 SPEED_TYPE_CLIMB_SPEED = 2,
4299 #[doc = "Descent speed"]
4300 SPEED_TYPE_DESCENT_SPEED = 3,
4301}
4302impl SpeedType {
4303 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4304}
4305impl Default for SpeedType {
4306 fn default() -> Self {
4307 Self::DEFAULT
4308 }
4309}
4310#[cfg_attr(feature = "ts", derive(TS))]
4311#[cfg_attr(feature = "ts", ts(export))]
4312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4314#[cfg_attr(feature = "serde", serde(tag = "type"))]
4315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4316#[repr(u32)]
4317#[doc = "Flags to indicate the status of camera storage."]
4318pub enum StorageStatus {
4319 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4320 STORAGE_STATUS_EMPTY = 0,
4321 #[doc = "Storage present but unformatted."]
4322 STORAGE_STATUS_UNFORMATTED = 1,
4323 #[doc = "Storage present and ready."]
4324 STORAGE_STATUS_READY = 2,
4325 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4326 STORAGE_STATUS_NOT_SUPPORTED = 3,
4327}
4328impl StorageStatus {
4329 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4330}
4331impl Default for StorageStatus {
4332 fn default() -> Self {
4333 Self::DEFAULT
4334 }
4335}
4336#[cfg_attr(feature = "ts", derive(TS))]
4337#[cfg_attr(feature = "ts", ts(export))]
4338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4340#[cfg_attr(feature = "serde", serde(tag = "type"))]
4341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4342#[repr(u32)]
4343#[doc = "Flags to indicate the type of storage."]
4344pub enum StorageType {
4345 #[doc = "Storage type is not known."]
4346 STORAGE_TYPE_UNKNOWN = 0,
4347 #[doc = "Storage type is USB device."]
4348 STORAGE_TYPE_USB_STICK = 1,
4349 #[doc = "Storage type is SD card."]
4350 STORAGE_TYPE_SD = 2,
4351 #[doc = "Storage type is microSD card."]
4352 STORAGE_TYPE_MICROSD = 3,
4353 #[doc = "Storage type is CFast."]
4354 STORAGE_TYPE_CF = 4,
4355 #[doc = "Storage type is CFexpress."]
4356 STORAGE_TYPE_CFE = 5,
4357 #[doc = "Storage type is XQD."]
4358 STORAGE_TYPE_XQD = 6,
4359 #[doc = "Storage type is HD mass storage type."]
4360 STORAGE_TYPE_HD = 7,
4361 #[doc = "Storage type is other, not listed type."]
4362 STORAGE_TYPE_OTHER = 254,
4363}
4364impl StorageType {
4365 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4366}
4367impl Default for StorageType {
4368 fn default() -> Self {
4369 Self::DEFAULT
4370 }
4371}
4372bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4373impl StorageUsageFlag {
4374 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4375}
4376impl Default for StorageUsageFlag {
4377 fn default() -> Self {
4378 Self::DEFAULT
4379 }
4380}
4381#[cfg_attr(feature = "ts", derive(TS))]
4382#[cfg_attr(feature = "ts", ts(export))]
4383#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4385#[cfg_attr(feature = "serde", serde(tag = "type"))]
4386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4387#[repr(u32)]
4388#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4389pub enum TuneFormat {
4390 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4391 TUNE_FORMAT_QBASIC1_1 = 1,
4392 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4393 TUNE_FORMAT_MML_MODERN = 2,
4394}
4395impl TuneFormat {
4396 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4397}
4398impl Default for TuneFormat {
4399 fn default() -> Self {
4400 Self::DEFAULT
4401 }
4402}
4403#[cfg_attr(feature = "ts", derive(TS))]
4404#[cfg_attr(feature = "ts", ts(export))]
4405#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4407#[cfg_attr(feature = "serde", serde(tag = "type"))]
4408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4409#[repr(u32)]
4410#[doc = "Generalized UAVCAN node health"]
4411pub enum UavcanNodeHealth {
4412 #[doc = "The node is functioning properly."]
4413 UAVCAN_NODE_HEALTH_OK = 0,
4414 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4415 UAVCAN_NODE_HEALTH_WARNING = 1,
4416 #[doc = "The node has encountered a major failure."]
4417 UAVCAN_NODE_HEALTH_ERROR = 2,
4418 #[doc = "The node has suffered a fatal malfunction."]
4419 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4420}
4421impl UavcanNodeHealth {
4422 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4423}
4424impl Default for UavcanNodeHealth {
4425 fn default() -> Self {
4426 Self::DEFAULT
4427 }
4428}
4429#[cfg_attr(feature = "ts", derive(TS))]
4430#[cfg_attr(feature = "ts", ts(export))]
4431#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4432#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4433#[cfg_attr(feature = "serde", serde(tag = "type"))]
4434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4435#[repr(u32)]
4436#[doc = "Generalized UAVCAN node mode"]
4437pub enum UavcanNodeMode {
4438 #[doc = "The node is performing its primary functions."]
4439 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4440 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4441 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4442 #[doc = "The node is under maintenance."]
4443 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4444 #[doc = "The node is in the process of updating its software."]
4445 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4446 #[doc = "The node is no longer available online."]
4447 UAVCAN_NODE_MODE_OFFLINE = 7,
4448}
4449impl UavcanNodeMode {
4450 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4451}
4452impl Default for UavcanNodeMode {
4453 fn default() -> Self {
4454 Self::DEFAULT
4455 }
4456}
4457bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4458impl UtmDataAvailFlags {
4459 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4460}
4461impl Default for UtmDataAvailFlags {
4462 fn default() -> Self {
4463 Self::DEFAULT
4464 }
4465}
4466#[cfg_attr(feature = "ts", derive(TS))]
4467#[cfg_attr(feature = "ts", ts(export))]
4468#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4469#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4470#[cfg_attr(feature = "serde", serde(tag = "type"))]
4471#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4472#[repr(u32)]
4473#[doc = "Airborne status of UAS."]
4474pub enum UtmFlightState {
4475 #[doc = "The flight state can't be determined."]
4476 UTM_FLIGHT_STATE_UNKNOWN = 1,
4477 #[doc = "UAS on ground."]
4478 UTM_FLIGHT_STATE_GROUND = 2,
4479 #[doc = "UAS airborne."]
4480 UTM_FLIGHT_STATE_AIRBORNE = 3,
4481 #[doc = "UAS is in an emergency flight state."]
4482 UTM_FLIGHT_STATE_EMERGENCY = 16,
4483 #[doc = "UAS has no active controls."]
4484 UTM_FLIGHT_STATE_NOCTRL = 32,
4485}
4486impl UtmFlightState {
4487 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4488}
4489impl Default for UtmFlightState {
4490 fn default() -> Self {
4491 Self::DEFAULT
4492 }
4493}
4494#[cfg_attr(feature = "ts", derive(TS))]
4495#[cfg_attr(feature = "ts", ts(export))]
4496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4498#[cfg_attr(feature = "serde", serde(tag = "type"))]
4499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4500#[repr(u32)]
4501#[doc = "Video stream encodings"]
4502pub enum VideoStreamEncoding {
4503 #[doc = "Stream encoding is unknown"]
4504 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4505 #[doc = "Stream encoding is H.264"]
4506 VIDEO_STREAM_ENCODING_H264 = 1,
4507 #[doc = "Stream encoding is H.265"]
4508 VIDEO_STREAM_ENCODING_H265 = 2,
4509}
4510impl VideoStreamEncoding {
4511 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4512}
4513impl Default for VideoStreamEncoding {
4514 fn default() -> Self {
4515 Self::DEFAULT
4516 }
4517}
4518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4519impl VideoStreamStatusFlags {
4520 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4521}
4522impl Default for VideoStreamStatusFlags {
4523 fn default() -> Self {
4524 Self::DEFAULT
4525 }
4526}
4527#[cfg_attr(feature = "ts", derive(TS))]
4528#[cfg_attr(feature = "ts", ts(export))]
4529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4531#[cfg_attr(feature = "serde", serde(tag = "type"))]
4532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4533#[repr(u32)]
4534#[doc = "Video stream types"]
4535pub enum VideoStreamType {
4536 #[doc = "Stream is RTSP"]
4537 VIDEO_STREAM_TYPE_RTSP = 0,
4538 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4539 VIDEO_STREAM_TYPE_RTPUDP = 1,
4540 #[doc = "Stream is MPEG on TCP"]
4541 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4542 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4543 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4544}
4545impl VideoStreamType {
4546 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4547}
4548impl Default for VideoStreamType {
4549 fn default() -> Self {
4550 Self::DEFAULT
4551 }
4552}
4553#[cfg_attr(feature = "ts", derive(TS))]
4554#[cfg_attr(feature = "ts", ts(export))]
4555#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4557#[cfg_attr(feature = "serde", serde(tag = "type"))]
4558#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4559#[repr(u32)]
4560#[doc = "Direction of VTOL transition"]
4561pub enum VtolTransitionHeading {
4562 #[doc = "Respect the heading configuration of the vehicle."]
4563 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4564 #[doc = "Use the heading pointing towards the next waypoint."]
4565 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4566 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4567 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4568 #[doc = "Use the specified heading in parameter 4."]
4569 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4570 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4571 VTOL_TRANSITION_HEADING_ANY = 4,
4572}
4573impl VtolTransitionHeading {
4574 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4575}
4576impl Default for VtolTransitionHeading {
4577 fn default() -> Self {
4578 Self::DEFAULT
4579 }
4580}
4581#[cfg_attr(feature = "ts", derive(TS))]
4582#[cfg_attr(feature = "ts", ts(export))]
4583#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4585#[cfg_attr(feature = "serde", serde(tag = "type"))]
4586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4587#[repr(u32)]
4588#[doc = "WiFi Mode."]
4589pub enum WifiConfigApMode {
4590 #[doc = "WiFi mode is undefined."]
4591 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4592 #[doc = "WiFi configured as an access point."]
4593 WIFI_CONFIG_AP_MODE_AP = 1,
4594 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4595 WIFI_CONFIG_AP_MODE_STATION = 2,
4596 #[doc = "WiFi disabled."]
4597 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4598}
4599impl WifiConfigApMode {
4600 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4601}
4602impl Default for WifiConfigApMode {
4603 fn default() -> Self {
4604 Self::DEFAULT
4605 }
4606}
4607#[cfg_attr(feature = "ts", derive(TS))]
4608#[cfg_attr(feature = "ts", ts(export))]
4609#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4611#[cfg_attr(feature = "serde", serde(tag = "type"))]
4612#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4613#[repr(u32)]
4614#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4615pub enum WifiConfigApResponse {
4616 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4617 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4618 #[doc = "Changes accepted."]
4619 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4620 #[doc = "Changes rejected."]
4621 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4622 #[doc = "Invalid Mode."]
4623 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4624 #[doc = "Invalid SSID."]
4625 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4626 #[doc = "Invalid Password."]
4627 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4628}
4629impl WifiConfigApResponse {
4630 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4631}
4632impl Default for WifiConfigApResponse {
4633 fn default() -> Self {
4634 Self::DEFAULT
4635 }
4636}
4637#[cfg_attr(feature = "ts", derive(TS))]
4638#[cfg_attr(feature = "ts", ts(export))]
4639#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4641#[cfg_attr(feature = "serde", serde(tag = "type"))]
4642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4643#[repr(u32)]
4644#[doc = "Winch actions."]
4645pub enum WinchActions {
4646 #[doc = "Allow motor to freewheel."]
4647 WINCH_RELAXED = 0,
4648 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4649 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4650 #[doc = "Wind or unwind line at specified rate."]
4651 WINCH_RATE_CONTROL = 2,
4652 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4653 WINCH_LOCK = 3,
4654 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4655 WINCH_DELIVER = 4,
4656 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4657 WINCH_HOLD = 5,
4658 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4659 WINCH_RETRACT = 6,
4660 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4661 WINCH_LOAD_LINE = 7,
4662 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4663 WINCH_ABANDON_LINE = 8,
4664 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4665 WINCH_LOAD_PAYLOAD = 9,
4666}
4667impl WinchActions {
4668 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4669}
4670impl Default for WinchActions {
4671 fn default() -> Self {
4672 Self::DEFAULT
4673 }
4674}
4675#[doc = "Set the vehicle attitude and body angular rates."]
4676#[doc = ""]
4677#[doc = "ID: 140"]
4678#[derive(Debug, Clone, PartialEq)]
4679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4681#[cfg_attr(feature = "ts", derive(TS))]
4682#[cfg_attr(feature = "ts", ts(export))]
4683pub struct ACTUATOR_CONTROL_TARGET_DATA {
4684 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4685 pub time_usec: u64,
4686 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4687 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4688 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4689 pub controls: [f32; 8],
4690 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4691 pub group_mlx: u8,
4692}
4693impl ACTUATOR_CONTROL_TARGET_DATA {
4694 pub const ENCODED_LEN: usize = 41usize;
4695 pub const DEFAULT: Self = Self {
4696 time_usec: 0_u64,
4697 controls: [0.0_f32; 8usize],
4698 group_mlx: 0_u8,
4699 };
4700 #[cfg(feature = "arbitrary")]
4701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4702 use arbitrary::{Arbitrary, Unstructured};
4703 let mut buf = [0u8; 1024];
4704 rng.fill_bytes(&mut buf);
4705 let mut unstructured = Unstructured::new(&buf);
4706 Self::arbitrary(&mut unstructured).unwrap_or_default()
4707 }
4708}
4709impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4710 fn default() -> Self {
4711 Self::DEFAULT.clone()
4712 }
4713}
4714impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4715 type Message = MavMessage;
4716 const ID: u32 = 140u32;
4717 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4718 const EXTRA_CRC: u8 = 181u8;
4719 const ENCODED_LEN: usize = 41usize;
4720 fn deser(
4721 _version: MavlinkVersion,
4722 __input: &[u8],
4723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4724 let avail_len = __input.len();
4725 let mut payload_buf = [0; Self::ENCODED_LEN];
4726 let mut buf = if avail_len < Self::ENCODED_LEN {
4727 payload_buf[0..avail_len].copy_from_slice(__input);
4728 Bytes::new(&payload_buf)
4729 } else {
4730 Bytes::new(__input)
4731 };
4732 let mut __struct = Self::default();
4733 __struct.time_usec = buf.get_u64_le();
4734 for v in &mut __struct.controls {
4735 let val = buf.get_f32_le();
4736 *v = val;
4737 }
4738 __struct.group_mlx = buf.get_u8();
4739 Ok(__struct)
4740 }
4741 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4742 let mut __tmp = BytesMut::new(bytes);
4743 #[allow(clippy::absurd_extreme_comparisons)]
4744 #[allow(unused_comparisons)]
4745 if __tmp.remaining() < Self::ENCODED_LEN {
4746 panic!(
4747 "buffer is too small (need {} bytes, but got {})",
4748 Self::ENCODED_LEN,
4749 __tmp.remaining(),
4750 )
4751 }
4752 __tmp.put_u64_le(self.time_usec);
4753 for val in &self.controls {
4754 __tmp.put_f32_le(*val);
4755 }
4756 __tmp.put_u8(self.group_mlx);
4757 if matches!(version, MavlinkVersion::V2) {
4758 let len = __tmp.len();
4759 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4760 } else {
4761 __tmp.len()
4762 }
4763 }
4764}
4765#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4766#[doc = ""]
4767#[doc = "ID: 375"]
4768#[derive(Debug, Clone, PartialEq)]
4769#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4771#[cfg_attr(feature = "ts", derive(TS))]
4772#[cfg_attr(feature = "ts", ts(export))]
4773pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4774 #[doc = "Timestamp (since system boot)."]
4775 pub time_usec: u64,
4776 #[doc = "Active outputs"]
4777 pub active: u32,
4778 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4779 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4780 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4781 pub actuator: [f32; 32],
4782}
4783impl ACTUATOR_OUTPUT_STATUS_DATA {
4784 pub const ENCODED_LEN: usize = 140usize;
4785 pub const DEFAULT: Self = Self {
4786 time_usec: 0_u64,
4787 active: 0_u32,
4788 actuator: [0.0_f32; 32usize],
4789 };
4790 #[cfg(feature = "arbitrary")]
4791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4792 use arbitrary::{Arbitrary, Unstructured};
4793 let mut buf = [0u8; 1024];
4794 rng.fill_bytes(&mut buf);
4795 let mut unstructured = Unstructured::new(&buf);
4796 Self::arbitrary(&mut unstructured).unwrap_or_default()
4797 }
4798}
4799impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4800 fn default() -> Self {
4801 Self::DEFAULT.clone()
4802 }
4803}
4804impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4805 type Message = MavMessage;
4806 const ID: u32 = 375u32;
4807 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4808 const EXTRA_CRC: u8 = 251u8;
4809 const ENCODED_LEN: usize = 140usize;
4810 fn deser(
4811 _version: MavlinkVersion,
4812 __input: &[u8],
4813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4814 let avail_len = __input.len();
4815 let mut payload_buf = [0; Self::ENCODED_LEN];
4816 let mut buf = if avail_len < Self::ENCODED_LEN {
4817 payload_buf[0..avail_len].copy_from_slice(__input);
4818 Bytes::new(&payload_buf)
4819 } else {
4820 Bytes::new(__input)
4821 };
4822 let mut __struct = Self::default();
4823 __struct.time_usec = buf.get_u64_le();
4824 __struct.active = buf.get_u32_le();
4825 for v in &mut __struct.actuator {
4826 let val = buf.get_f32_le();
4827 *v = val;
4828 }
4829 Ok(__struct)
4830 }
4831 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4832 let mut __tmp = BytesMut::new(bytes);
4833 #[allow(clippy::absurd_extreme_comparisons)]
4834 #[allow(unused_comparisons)]
4835 if __tmp.remaining() < Self::ENCODED_LEN {
4836 panic!(
4837 "buffer is too small (need {} bytes, but got {})",
4838 Self::ENCODED_LEN,
4839 __tmp.remaining(),
4840 )
4841 }
4842 __tmp.put_u64_le(self.time_usec);
4843 __tmp.put_u32_le(self.active);
4844 for val in &self.actuator {
4845 __tmp.put_f32_le(*val);
4846 }
4847 if matches!(version, MavlinkVersion::V2) {
4848 let len = __tmp.len();
4849 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4850 } else {
4851 __tmp.len()
4852 }
4853 }
4854}
4855#[doc = "The location and information of an ADSB vehicle."]
4856#[doc = ""]
4857#[doc = "ID: 246"]
4858#[derive(Debug, Clone, PartialEq)]
4859#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4860#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4861#[cfg_attr(feature = "ts", derive(TS))]
4862#[cfg_attr(feature = "ts", ts(export))]
4863pub struct ADSB_VEHICLE_DATA {
4864 #[doc = "ICAO address"]
4865 pub ICAO_address: u32,
4866 #[doc = "Latitude"]
4867 pub lat: i32,
4868 #[doc = "Longitude"]
4869 pub lon: i32,
4870 #[doc = "Altitude(ASL)"]
4871 pub altitude: i32,
4872 #[doc = "Course over ground"]
4873 pub heading: u16,
4874 #[doc = "The horizontal velocity"]
4875 pub hor_velocity: u16,
4876 #[doc = "The vertical velocity. Positive is up"]
4877 pub ver_velocity: i16,
4878 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4879 pub flags: AdsbFlags,
4880 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4881 pub squawk: u16,
4882 #[doc = "ADSB altitude type."]
4883 pub altitude_type: AdsbAltitudeType,
4884 #[doc = "The callsign, 8+null"]
4885 #[cfg_attr(feature = "ts", ts(type = "string"))]
4886 pub callsign: CharArray<9>,
4887 #[doc = "ADSB emitter type."]
4888 pub emitter_type: AdsbEmitterType,
4889 #[doc = "Time since last communication in seconds"]
4890 pub tslc: u8,
4891}
4892impl ADSB_VEHICLE_DATA {
4893 pub const ENCODED_LEN: usize = 38usize;
4894 pub const DEFAULT: Self = Self {
4895 ICAO_address: 0_u32,
4896 lat: 0_i32,
4897 lon: 0_i32,
4898 altitude: 0_i32,
4899 heading: 0_u16,
4900 hor_velocity: 0_u16,
4901 ver_velocity: 0_i16,
4902 flags: AdsbFlags::DEFAULT,
4903 squawk: 0_u16,
4904 altitude_type: AdsbAltitudeType::DEFAULT,
4905 callsign: CharArray::new([0_u8; 9usize]),
4906 emitter_type: AdsbEmitterType::DEFAULT,
4907 tslc: 0_u8,
4908 };
4909 #[cfg(feature = "arbitrary")]
4910 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4911 use arbitrary::{Arbitrary, Unstructured};
4912 let mut buf = [0u8; 1024];
4913 rng.fill_bytes(&mut buf);
4914 let mut unstructured = Unstructured::new(&buf);
4915 Self::arbitrary(&mut unstructured).unwrap_or_default()
4916 }
4917}
4918impl Default for ADSB_VEHICLE_DATA {
4919 fn default() -> Self {
4920 Self::DEFAULT.clone()
4921 }
4922}
4923impl MessageData for ADSB_VEHICLE_DATA {
4924 type Message = MavMessage;
4925 const ID: u32 = 246u32;
4926 const NAME: &'static str = "ADSB_VEHICLE";
4927 const EXTRA_CRC: u8 = 184u8;
4928 const ENCODED_LEN: usize = 38usize;
4929 fn deser(
4930 _version: MavlinkVersion,
4931 __input: &[u8],
4932 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4933 let avail_len = __input.len();
4934 let mut payload_buf = [0; Self::ENCODED_LEN];
4935 let mut buf = if avail_len < Self::ENCODED_LEN {
4936 payload_buf[0..avail_len].copy_from_slice(__input);
4937 Bytes::new(&payload_buf)
4938 } else {
4939 Bytes::new(__input)
4940 };
4941 let mut __struct = Self::default();
4942 __struct.ICAO_address = buf.get_u32_le();
4943 __struct.lat = buf.get_i32_le();
4944 __struct.lon = buf.get_i32_le();
4945 __struct.altitude = buf.get_i32_le();
4946 __struct.heading = buf.get_u16_le();
4947 __struct.hor_velocity = buf.get_u16_le();
4948 __struct.ver_velocity = buf.get_i16_le();
4949 let tmp = buf.get_u16_le();
4950 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4951 ::mavlink_core::error::ParserError::InvalidFlag {
4952 flag_type: "AdsbFlags",
4953 value: tmp as u32,
4954 },
4955 )?;
4956 __struct.squawk = buf.get_u16_le();
4957 let tmp = buf.get_u8();
4958 __struct.altitude_type =
4959 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4960 enum_type: "AdsbAltitudeType",
4961 value: tmp as u32,
4962 })?;
4963 let mut tmp = [0_u8; 9usize];
4964 for v in &mut tmp {
4965 *v = buf.get_u8();
4966 }
4967 __struct.callsign = CharArray::new(tmp);
4968 let tmp = buf.get_u8();
4969 __struct.emitter_type =
4970 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4971 enum_type: "AdsbEmitterType",
4972 value: tmp as u32,
4973 })?;
4974 __struct.tslc = buf.get_u8();
4975 Ok(__struct)
4976 }
4977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4978 let mut __tmp = BytesMut::new(bytes);
4979 #[allow(clippy::absurd_extreme_comparisons)]
4980 #[allow(unused_comparisons)]
4981 if __tmp.remaining() < Self::ENCODED_LEN {
4982 panic!(
4983 "buffer is too small (need {} bytes, but got {})",
4984 Self::ENCODED_LEN,
4985 __tmp.remaining(),
4986 )
4987 }
4988 __tmp.put_u32_le(self.ICAO_address);
4989 __tmp.put_i32_le(self.lat);
4990 __tmp.put_i32_le(self.lon);
4991 __tmp.put_i32_le(self.altitude);
4992 __tmp.put_u16_le(self.heading);
4993 __tmp.put_u16_le(self.hor_velocity);
4994 __tmp.put_i16_le(self.ver_velocity);
4995 __tmp.put_u16_le(self.flags.bits());
4996 __tmp.put_u16_le(self.squawk);
4997 __tmp.put_u8(self.altitude_type as u8);
4998 for val in &self.callsign {
4999 __tmp.put_u8(*val);
5000 }
5001 __tmp.put_u8(self.emitter_type as u8);
5002 __tmp.put_u8(self.tslc);
5003 if matches!(version, MavlinkVersion::V2) {
5004 let len = __tmp.len();
5005 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5006 } else {
5007 __tmp.len()
5008 }
5009 }
5010}
5011#[doc = "The location and information of an AIS vessel."]
5012#[doc = ""]
5013#[doc = "ID: 301"]
5014#[derive(Debug, Clone, PartialEq)]
5015#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5016#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5017#[cfg_attr(feature = "ts", derive(TS))]
5018#[cfg_attr(feature = "ts", ts(export))]
5019pub struct AIS_VESSEL_DATA {
5020 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5021 pub MMSI: u32,
5022 #[doc = "Latitude"]
5023 pub lat: i32,
5024 #[doc = "Longitude"]
5025 pub lon: i32,
5026 #[doc = "Course over ground"]
5027 pub COG: u16,
5028 #[doc = "True heading"]
5029 pub heading: u16,
5030 #[doc = "Speed over ground"]
5031 pub velocity: u16,
5032 #[doc = "Distance from lat/lon location to bow"]
5033 pub dimension_bow: u16,
5034 #[doc = "Distance from lat/lon location to stern"]
5035 pub dimension_stern: u16,
5036 #[doc = "Time since last communication in seconds"]
5037 pub tslc: u16,
5038 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5039 pub flags: AisFlags,
5040 #[doc = "Turn rate"]
5041 pub turn_rate: i8,
5042 #[doc = "Navigational status"]
5043 pub navigational_status: AisNavStatus,
5044 #[doc = "Type of vessels"]
5045 pub mavtype: AisType,
5046 #[doc = "Distance from lat/lon location to port side"]
5047 pub dimension_port: u8,
5048 #[doc = "Distance from lat/lon location to starboard side"]
5049 pub dimension_starboard: u8,
5050 #[doc = "The vessel callsign"]
5051 #[cfg_attr(feature = "ts", ts(type = "string"))]
5052 pub callsign: CharArray<7>,
5053 #[doc = "The vessel name"]
5054 #[cfg_attr(feature = "ts", ts(type = "string"))]
5055 pub name: CharArray<20>,
5056}
5057impl AIS_VESSEL_DATA {
5058 pub const ENCODED_LEN: usize = 58usize;
5059 pub const DEFAULT: Self = Self {
5060 MMSI: 0_u32,
5061 lat: 0_i32,
5062 lon: 0_i32,
5063 COG: 0_u16,
5064 heading: 0_u16,
5065 velocity: 0_u16,
5066 dimension_bow: 0_u16,
5067 dimension_stern: 0_u16,
5068 tslc: 0_u16,
5069 flags: AisFlags::DEFAULT,
5070 turn_rate: 0_i8,
5071 navigational_status: AisNavStatus::DEFAULT,
5072 mavtype: AisType::DEFAULT,
5073 dimension_port: 0_u8,
5074 dimension_starboard: 0_u8,
5075 callsign: CharArray::new([0_u8; 7usize]),
5076 name: CharArray::new([0_u8; 20usize]),
5077 };
5078 #[cfg(feature = "arbitrary")]
5079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5080 use arbitrary::{Arbitrary, Unstructured};
5081 let mut buf = [0u8; 1024];
5082 rng.fill_bytes(&mut buf);
5083 let mut unstructured = Unstructured::new(&buf);
5084 Self::arbitrary(&mut unstructured).unwrap_or_default()
5085 }
5086}
5087impl Default for AIS_VESSEL_DATA {
5088 fn default() -> Self {
5089 Self::DEFAULT.clone()
5090 }
5091}
5092impl MessageData for AIS_VESSEL_DATA {
5093 type Message = MavMessage;
5094 const ID: u32 = 301u32;
5095 const NAME: &'static str = "AIS_VESSEL";
5096 const EXTRA_CRC: u8 = 243u8;
5097 const ENCODED_LEN: usize = 58usize;
5098 fn deser(
5099 _version: MavlinkVersion,
5100 __input: &[u8],
5101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5102 let avail_len = __input.len();
5103 let mut payload_buf = [0; Self::ENCODED_LEN];
5104 let mut buf = if avail_len < Self::ENCODED_LEN {
5105 payload_buf[0..avail_len].copy_from_slice(__input);
5106 Bytes::new(&payload_buf)
5107 } else {
5108 Bytes::new(__input)
5109 };
5110 let mut __struct = Self::default();
5111 __struct.MMSI = buf.get_u32_le();
5112 __struct.lat = buf.get_i32_le();
5113 __struct.lon = buf.get_i32_le();
5114 __struct.COG = buf.get_u16_le();
5115 __struct.heading = buf.get_u16_le();
5116 __struct.velocity = buf.get_u16_le();
5117 __struct.dimension_bow = buf.get_u16_le();
5118 __struct.dimension_stern = buf.get_u16_le();
5119 __struct.tslc = buf.get_u16_le();
5120 let tmp = buf.get_u16_le();
5121 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
5122 ::mavlink_core::error::ParserError::InvalidFlag {
5123 flag_type: "AisFlags",
5124 value: tmp as u32,
5125 },
5126 )?;
5127 __struct.turn_rate = buf.get_i8();
5128 let tmp = buf.get_u8();
5129 __struct.navigational_status =
5130 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5131 enum_type: "AisNavStatus",
5132 value: tmp as u32,
5133 })?;
5134 let tmp = buf.get_u8();
5135 __struct.mavtype =
5136 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5137 enum_type: "AisType",
5138 value: tmp as u32,
5139 })?;
5140 __struct.dimension_port = buf.get_u8();
5141 __struct.dimension_starboard = buf.get_u8();
5142 let mut tmp = [0_u8; 7usize];
5143 for v in &mut tmp {
5144 *v = buf.get_u8();
5145 }
5146 __struct.callsign = CharArray::new(tmp);
5147 let mut tmp = [0_u8; 20usize];
5148 for v in &mut tmp {
5149 *v = buf.get_u8();
5150 }
5151 __struct.name = CharArray::new(tmp);
5152 Ok(__struct)
5153 }
5154 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5155 let mut __tmp = BytesMut::new(bytes);
5156 #[allow(clippy::absurd_extreme_comparisons)]
5157 #[allow(unused_comparisons)]
5158 if __tmp.remaining() < Self::ENCODED_LEN {
5159 panic!(
5160 "buffer is too small (need {} bytes, but got {})",
5161 Self::ENCODED_LEN,
5162 __tmp.remaining(),
5163 )
5164 }
5165 __tmp.put_u32_le(self.MMSI);
5166 __tmp.put_i32_le(self.lat);
5167 __tmp.put_i32_le(self.lon);
5168 __tmp.put_u16_le(self.COG);
5169 __tmp.put_u16_le(self.heading);
5170 __tmp.put_u16_le(self.velocity);
5171 __tmp.put_u16_le(self.dimension_bow);
5172 __tmp.put_u16_le(self.dimension_stern);
5173 __tmp.put_u16_le(self.tslc);
5174 __tmp.put_u16_le(self.flags.bits());
5175 __tmp.put_i8(self.turn_rate);
5176 __tmp.put_u8(self.navigational_status as u8);
5177 __tmp.put_u8(self.mavtype as u8);
5178 __tmp.put_u8(self.dimension_port);
5179 __tmp.put_u8(self.dimension_starboard);
5180 for val in &self.callsign {
5181 __tmp.put_u8(*val);
5182 }
5183 for val in &self.name {
5184 __tmp.put_u8(*val);
5185 }
5186 if matches!(version, MavlinkVersion::V2) {
5187 let len = __tmp.len();
5188 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5189 } else {
5190 __tmp.len()
5191 }
5192 }
5193}
5194#[doc = "The current system altitude."]
5195#[doc = ""]
5196#[doc = "ID: 141"]
5197#[derive(Debug, Clone, PartialEq)]
5198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5199#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5200#[cfg_attr(feature = "ts", derive(TS))]
5201#[cfg_attr(feature = "ts", ts(export))]
5202pub struct ALTITUDE_DATA {
5203 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5204 pub time_usec: u64,
5205 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5206 pub altitude_monotonic: f32,
5207 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5208 pub altitude_amsl: f32,
5209 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5210 pub altitude_local: f32,
5211 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5212 pub altitude_relative: f32,
5213 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5214 pub altitude_terrain: f32,
5215 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5216 pub bottom_clearance: f32,
5217}
5218impl ALTITUDE_DATA {
5219 pub const ENCODED_LEN: usize = 32usize;
5220 pub const DEFAULT: Self = Self {
5221 time_usec: 0_u64,
5222 altitude_monotonic: 0.0_f32,
5223 altitude_amsl: 0.0_f32,
5224 altitude_local: 0.0_f32,
5225 altitude_relative: 0.0_f32,
5226 altitude_terrain: 0.0_f32,
5227 bottom_clearance: 0.0_f32,
5228 };
5229 #[cfg(feature = "arbitrary")]
5230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5231 use arbitrary::{Arbitrary, Unstructured};
5232 let mut buf = [0u8; 1024];
5233 rng.fill_bytes(&mut buf);
5234 let mut unstructured = Unstructured::new(&buf);
5235 Self::arbitrary(&mut unstructured).unwrap_or_default()
5236 }
5237}
5238impl Default for ALTITUDE_DATA {
5239 fn default() -> Self {
5240 Self::DEFAULT.clone()
5241 }
5242}
5243impl MessageData for ALTITUDE_DATA {
5244 type Message = MavMessage;
5245 const ID: u32 = 141u32;
5246 const NAME: &'static str = "ALTITUDE";
5247 const EXTRA_CRC: u8 = 47u8;
5248 const ENCODED_LEN: usize = 32usize;
5249 fn deser(
5250 _version: MavlinkVersion,
5251 __input: &[u8],
5252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5253 let avail_len = __input.len();
5254 let mut payload_buf = [0; Self::ENCODED_LEN];
5255 let mut buf = if avail_len < Self::ENCODED_LEN {
5256 payload_buf[0..avail_len].copy_from_slice(__input);
5257 Bytes::new(&payload_buf)
5258 } else {
5259 Bytes::new(__input)
5260 };
5261 let mut __struct = Self::default();
5262 __struct.time_usec = buf.get_u64_le();
5263 __struct.altitude_monotonic = buf.get_f32_le();
5264 __struct.altitude_amsl = buf.get_f32_le();
5265 __struct.altitude_local = buf.get_f32_le();
5266 __struct.altitude_relative = buf.get_f32_le();
5267 __struct.altitude_terrain = buf.get_f32_le();
5268 __struct.bottom_clearance = buf.get_f32_le();
5269 Ok(__struct)
5270 }
5271 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5272 let mut __tmp = BytesMut::new(bytes);
5273 #[allow(clippy::absurd_extreme_comparisons)]
5274 #[allow(unused_comparisons)]
5275 if __tmp.remaining() < Self::ENCODED_LEN {
5276 panic!(
5277 "buffer is too small (need {} bytes, but got {})",
5278 Self::ENCODED_LEN,
5279 __tmp.remaining(),
5280 )
5281 }
5282 __tmp.put_u64_le(self.time_usec);
5283 __tmp.put_f32_le(self.altitude_monotonic);
5284 __tmp.put_f32_le(self.altitude_amsl);
5285 __tmp.put_f32_le(self.altitude_local);
5286 __tmp.put_f32_le(self.altitude_relative);
5287 __tmp.put_f32_le(self.altitude_terrain);
5288 __tmp.put_f32_le(self.bottom_clearance);
5289 if matches!(version, MavlinkVersion::V2) {
5290 let len = __tmp.len();
5291 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5292 } else {
5293 __tmp.len()
5294 }
5295 }
5296}
5297#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5298#[doc = ""]
5299#[doc = "ID: 30"]
5300#[derive(Debug, Clone, PartialEq)]
5301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5303#[cfg_attr(feature = "ts", derive(TS))]
5304#[cfg_attr(feature = "ts", ts(export))]
5305pub struct ATTITUDE_DATA {
5306 #[doc = "Timestamp (time since system boot)."]
5307 pub time_boot_ms: u32,
5308 #[doc = "Roll angle (-pi..+pi)"]
5309 pub roll: f32,
5310 #[doc = "Pitch angle (-pi..+pi)"]
5311 pub pitch: f32,
5312 #[doc = "Yaw angle (-pi..+pi)"]
5313 pub yaw: f32,
5314 #[doc = "Roll angular speed"]
5315 pub rollspeed: f32,
5316 #[doc = "Pitch angular speed"]
5317 pub pitchspeed: f32,
5318 #[doc = "Yaw angular speed"]
5319 pub yawspeed: f32,
5320}
5321impl ATTITUDE_DATA {
5322 pub const ENCODED_LEN: usize = 28usize;
5323 pub const DEFAULT: Self = Self {
5324 time_boot_ms: 0_u32,
5325 roll: 0.0_f32,
5326 pitch: 0.0_f32,
5327 yaw: 0.0_f32,
5328 rollspeed: 0.0_f32,
5329 pitchspeed: 0.0_f32,
5330 yawspeed: 0.0_f32,
5331 };
5332 #[cfg(feature = "arbitrary")]
5333 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5334 use arbitrary::{Arbitrary, Unstructured};
5335 let mut buf = [0u8; 1024];
5336 rng.fill_bytes(&mut buf);
5337 let mut unstructured = Unstructured::new(&buf);
5338 Self::arbitrary(&mut unstructured).unwrap_or_default()
5339 }
5340}
5341impl Default for ATTITUDE_DATA {
5342 fn default() -> Self {
5343 Self::DEFAULT.clone()
5344 }
5345}
5346impl MessageData for ATTITUDE_DATA {
5347 type Message = MavMessage;
5348 const ID: u32 = 30u32;
5349 const NAME: &'static str = "ATTITUDE";
5350 const EXTRA_CRC: u8 = 39u8;
5351 const ENCODED_LEN: usize = 28usize;
5352 fn deser(
5353 _version: MavlinkVersion,
5354 __input: &[u8],
5355 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5356 let avail_len = __input.len();
5357 let mut payload_buf = [0; Self::ENCODED_LEN];
5358 let mut buf = if avail_len < Self::ENCODED_LEN {
5359 payload_buf[0..avail_len].copy_from_slice(__input);
5360 Bytes::new(&payload_buf)
5361 } else {
5362 Bytes::new(__input)
5363 };
5364 let mut __struct = Self::default();
5365 __struct.time_boot_ms = buf.get_u32_le();
5366 __struct.roll = buf.get_f32_le();
5367 __struct.pitch = buf.get_f32_le();
5368 __struct.yaw = buf.get_f32_le();
5369 __struct.rollspeed = buf.get_f32_le();
5370 __struct.pitchspeed = buf.get_f32_le();
5371 __struct.yawspeed = buf.get_f32_le();
5372 Ok(__struct)
5373 }
5374 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5375 let mut __tmp = BytesMut::new(bytes);
5376 #[allow(clippy::absurd_extreme_comparisons)]
5377 #[allow(unused_comparisons)]
5378 if __tmp.remaining() < Self::ENCODED_LEN {
5379 panic!(
5380 "buffer is too small (need {} bytes, but got {})",
5381 Self::ENCODED_LEN,
5382 __tmp.remaining(),
5383 )
5384 }
5385 __tmp.put_u32_le(self.time_boot_ms);
5386 __tmp.put_f32_le(self.roll);
5387 __tmp.put_f32_le(self.pitch);
5388 __tmp.put_f32_le(self.yaw);
5389 __tmp.put_f32_le(self.rollspeed);
5390 __tmp.put_f32_le(self.pitchspeed);
5391 __tmp.put_f32_le(self.yawspeed);
5392 if matches!(version, MavlinkVersion::V2) {
5393 let len = __tmp.len();
5394 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5395 } else {
5396 __tmp.len()
5397 }
5398 }
5399}
5400#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5401#[doc = ""]
5402#[doc = "ID: 31"]
5403#[derive(Debug, Clone, PartialEq)]
5404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5406#[cfg_attr(feature = "ts", derive(TS))]
5407#[cfg_attr(feature = "ts", ts(export))]
5408pub struct ATTITUDE_QUATERNION_DATA {
5409 #[doc = "Timestamp (time since system boot)."]
5410 pub time_boot_ms: u32,
5411 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5412 pub q1: f32,
5413 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5414 pub q2: f32,
5415 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5416 pub q3: f32,
5417 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5418 pub q4: f32,
5419 #[doc = "Roll angular speed"]
5420 pub rollspeed: f32,
5421 #[doc = "Pitch angular speed"]
5422 pub pitchspeed: f32,
5423 #[doc = "Yaw angular speed"]
5424 pub yawspeed: f32,
5425 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5426 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5427 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5428 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5429 pub repr_offset_q: [f32; 4],
5430}
5431impl ATTITUDE_QUATERNION_DATA {
5432 pub const ENCODED_LEN: usize = 48usize;
5433 pub const DEFAULT: Self = Self {
5434 time_boot_ms: 0_u32,
5435 q1: 0.0_f32,
5436 q2: 0.0_f32,
5437 q3: 0.0_f32,
5438 q4: 0.0_f32,
5439 rollspeed: 0.0_f32,
5440 pitchspeed: 0.0_f32,
5441 yawspeed: 0.0_f32,
5442 repr_offset_q: [0.0_f32; 4usize],
5443 };
5444 #[cfg(feature = "arbitrary")]
5445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5446 use arbitrary::{Arbitrary, Unstructured};
5447 let mut buf = [0u8; 1024];
5448 rng.fill_bytes(&mut buf);
5449 let mut unstructured = Unstructured::new(&buf);
5450 Self::arbitrary(&mut unstructured).unwrap_or_default()
5451 }
5452}
5453impl Default for ATTITUDE_QUATERNION_DATA {
5454 fn default() -> Self {
5455 Self::DEFAULT.clone()
5456 }
5457}
5458impl MessageData for ATTITUDE_QUATERNION_DATA {
5459 type Message = MavMessage;
5460 const ID: u32 = 31u32;
5461 const NAME: &'static str = "ATTITUDE_QUATERNION";
5462 const EXTRA_CRC: u8 = 246u8;
5463 const ENCODED_LEN: usize = 48usize;
5464 fn deser(
5465 _version: MavlinkVersion,
5466 __input: &[u8],
5467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5468 let avail_len = __input.len();
5469 let mut payload_buf = [0; Self::ENCODED_LEN];
5470 let mut buf = if avail_len < Self::ENCODED_LEN {
5471 payload_buf[0..avail_len].copy_from_slice(__input);
5472 Bytes::new(&payload_buf)
5473 } else {
5474 Bytes::new(__input)
5475 };
5476 let mut __struct = Self::default();
5477 __struct.time_boot_ms = buf.get_u32_le();
5478 __struct.q1 = buf.get_f32_le();
5479 __struct.q2 = buf.get_f32_le();
5480 __struct.q3 = buf.get_f32_le();
5481 __struct.q4 = buf.get_f32_le();
5482 __struct.rollspeed = buf.get_f32_le();
5483 __struct.pitchspeed = buf.get_f32_le();
5484 __struct.yawspeed = buf.get_f32_le();
5485 for v in &mut __struct.repr_offset_q {
5486 let val = buf.get_f32_le();
5487 *v = val;
5488 }
5489 Ok(__struct)
5490 }
5491 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5492 let mut __tmp = BytesMut::new(bytes);
5493 #[allow(clippy::absurd_extreme_comparisons)]
5494 #[allow(unused_comparisons)]
5495 if __tmp.remaining() < Self::ENCODED_LEN {
5496 panic!(
5497 "buffer is too small (need {} bytes, but got {})",
5498 Self::ENCODED_LEN,
5499 __tmp.remaining(),
5500 )
5501 }
5502 __tmp.put_u32_le(self.time_boot_ms);
5503 __tmp.put_f32_le(self.q1);
5504 __tmp.put_f32_le(self.q2);
5505 __tmp.put_f32_le(self.q3);
5506 __tmp.put_f32_le(self.q4);
5507 __tmp.put_f32_le(self.rollspeed);
5508 __tmp.put_f32_le(self.pitchspeed);
5509 __tmp.put_f32_le(self.yawspeed);
5510 if matches!(version, MavlinkVersion::V2) {
5511 for val in &self.repr_offset_q {
5512 __tmp.put_f32_le(*val);
5513 }
5514 let len = __tmp.len();
5515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5516 } else {
5517 __tmp.len()
5518 }
5519 }
5520}
5521#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5522#[doc = ""]
5523#[doc = "ID: 61"]
5524#[derive(Debug, Clone, PartialEq)]
5525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5527#[cfg_attr(feature = "ts", derive(TS))]
5528#[cfg_attr(feature = "ts", ts(export))]
5529pub struct ATTITUDE_QUATERNION_COV_DATA {
5530 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5531 pub time_usec: u64,
5532 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5533 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5534 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5535 pub q: [f32; 4],
5536 #[doc = "Roll angular speed"]
5537 pub rollspeed: f32,
5538 #[doc = "Pitch angular speed"]
5539 pub pitchspeed: f32,
5540 #[doc = "Yaw angular speed"]
5541 pub yawspeed: f32,
5542 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5543 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5544 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5545 pub covariance: [f32; 9],
5546}
5547impl ATTITUDE_QUATERNION_COV_DATA {
5548 pub const ENCODED_LEN: usize = 72usize;
5549 pub const DEFAULT: Self = Self {
5550 time_usec: 0_u64,
5551 q: [0.0_f32; 4usize],
5552 rollspeed: 0.0_f32,
5553 pitchspeed: 0.0_f32,
5554 yawspeed: 0.0_f32,
5555 covariance: [0.0_f32; 9usize],
5556 };
5557 #[cfg(feature = "arbitrary")]
5558 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5559 use arbitrary::{Arbitrary, Unstructured};
5560 let mut buf = [0u8; 1024];
5561 rng.fill_bytes(&mut buf);
5562 let mut unstructured = Unstructured::new(&buf);
5563 Self::arbitrary(&mut unstructured).unwrap_or_default()
5564 }
5565}
5566impl Default for ATTITUDE_QUATERNION_COV_DATA {
5567 fn default() -> Self {
5568 Self::DEFAULT.clone()
5569 }
5570}
5571impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5572 type Message = MavMessage;
5573 const ID: u32 = 61u32;
5574 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5575 const EXTRA_CRC: u8 = 167u8;
5576 const ENCODED_LEN: usize = 72usize;
5577 fn deser(
5578 _version: MavlinkVersion,
5579 __input: &[u8],
5580 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5581 let avail_len = __input.len();
5582 let mut payload_buf = [0; Self::ENCODED_LEN];
5583 let mut buf = if avail_len < Self::ENCODED_LEN {
5584 payload_buf[0..avail_len].copy_from_slice(__input);
5585 Bytes::new(&payload_buf)
5586 } else {
5587 Bytes::new(__input)
5588 };
5589 let mut __struct = Self::default();
5590 __struct.time_usec = buf.get_u64_le();
5591 for v in &mut __struct.q {
5592 let val = buf.get_f32_le();
5593 *v = val;
5594 }
5595 __struct.rollspeed = buf.get_f32_le();
5596 __struct.pitchspeed = buf.get_f32_le();
5597 __struct.yawspeed = buf.get_f32_le();
5598 for v in &mut __struct.covariance {
5599 let val = buf.get_f32_le();
5600 *v = val;
5601 }
5602 Ok(__struct)
5603 }
5604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5605 let mut __tmp = BytesMut::new(bytes);
5606 #[allow(clippy::absurd_extreme_comparisons)]
5607 #[allow(unused_comparisons)]
5608 if __tmp.remaining() < Self::ENCODED_LEN {
5609 panic!(
5610 "buffer is too small (need {} bytes, but got {})",
5611 Self::ENCODED_LEN,
5612 __tmp.remaining(),
5613 )
5614 }
5615 __tmp.put_u64_le(self.time_usec);
5616 for val in &self.q {
5617 __tmp.put_f32_le(*val);
5618 }
5619 __tmp.put_f32_le(self.rollspeed);
5620 __tmp.put_f32_le(self.pitchspeed);
5621 __tmp.put_f32_le(self.yawspeed);
5622 for val in &self.covariance {
5623 __tmp.put_f32_le(*val);
5624 }
5625 if matches!(version, MavlinkVersion::V2) {
5626 let len = __tmp.len();
5627 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5628 } else {
5629 __tmp.len()
5630 }
5631 }
5632}
5633#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5634#[doc = ""]
5635#[doc = "ID: 83"]
5636#[derive(Debug, Clone, PartialEq)]
5637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5638#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5639#[cfg_attr(feature = "ts", derive(TS))]
5640#[cfg_attr(feature = "ts", ts(export))]
5641pub struct ATTITUDE_TARGET_DATA {
5642 #[doc = "Timestamp (time since system boot)."]
5643 pub time_boot_ms: u32,
5644 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5645 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5646 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5647 pub q: [f32; 4],
5648 #[doc = "Body roll rate"]
5649 pub body_roll_rate: f32,
5650 #[doc = "Body pitch rate"]
5651 pub body_pitch_rate: f32,
5652 #[doc = "Body yaw rate"]
5653 pub body_yaw_rate: f32,
5654 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5655 pub thrust: f32,
5656 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5657 pub type_mask: AttitudeTargetTypemask,
5658}
5659impl ATTITUDE_TARGET_DATA {
5660 pub const ENCODED_LEN: usize = 37usize;
5661 pub const DEFAULT: Self = Self {
5662 time_boot_ms: 0_u32,
5663 q: [0.0_f32; 4usize],
5664 body_roll_rate: 0.0_f32,
5665 body_pitch_rate: 0.0_f32,
5666 body_yaw_rate: 0.0_f32,
5667 thrust: 0.0_f32,
5668 type_mask: AttitudeTargetTypemask::DEFAULT,
5669 };
5670 #[cfg(feature = "arbitrary")]
5671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5672 use arbitrary::{Arbitrary, Unstructured};
5673 let mut buf = [0u8; 1024];
5674 rng.fill_bytes(&mut buf);
5675 let mut unstructured = Unstructured::new(&buf);
5676 Self::arbitrary(&mut unstructured).unwrap_or_default()
5677 }
5678}
5679impl Default for ATTITUDE_TARGET_DATA {
5680 fn default() -> Self {
5681 Self::DEFAULT.clone()
5682 }
5683}
5684impl MessageData for ATTITUDE_TARGET_DATA {
5685 type Message = MavMessage;
5686 const ID: u32 = 83u32;
5687 const NAME: &'static str = "ATTITUDE_TARGET";
5688 const EXTRA_CRC: u8 = 22u8;
5689 const ENCODED_LEN: usize = 37usize;
5690 fn deser(
5691 _version: MavlinkVersion,
5692 __input: &[u8],
5693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5694 let avail_len = __input.len();
5695 let mut payload_buf = [0; Self::ENCODED_LEN];
5696 let mut buf = if avail_len < Self::ENCODED_LEN {
5697 payload_buf[0..avail_len].copy_from_slice(__input);
5698 Bytes::new(&payload_buf)
5699 } else {
5700 Bytes::new(__input)
5701 };
5702 let mut __struct = Self::default();
5703 __struct.time_boot_ms = buf.get_u32_le();
5704 for v in &mut __struct.q {
5705 let val = buf.get_f32_le();
5706 *v = val;
5707 }
5708 __struct.body_roll_rate = buf.get_f32_le();
5709 __struct.body_pitch_rate = buf.get_f32_le();
5710 __struct.body_yaw_rate = buf.get_f32_le();
5711 __struct.thrust = buf.get_f32_le();
5712 let tmp = buf.get_u8();
5713 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5714 tmp & AttitudeTargetTypemask::all().bits(),
5715 )
5716 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5717 flag_type: "AttitudeTargetTypemask",
5718 value: tmp as u32,
5719 })?;
5720 Ok(__struct)
5721 }
5722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5723 let mut __tmp = BytesMut::new(bytes);
5724 #[allow(clippy::absurd_extreme_comparisons)]
5725 #[allow(unused_comparisons)]
5726 if __tmp.remaining() < Self::ENCODED_LEN {
5727 panic!(
5728 "buffer is too small (need {} bytes, but got {})",
5729 Self::ENCODED_LEN,
5730 __tmp.remaining(),
5731 )
5732 }
5733 __tmp.put_u32_le(self.time_boot_ms);
5734 for val in &self.q {
5735 __tmp.put_f32_le(*val);
5736 }
5737 __tmp.put_f32_le(self.body_roll_rate);
5738 __tmp.put_f32_le(self.body_pitch_rate);
5739 __tmp.put_f32_le(self.body_yaw_rate);
5740 __tmp.put_f32_le(self.thrust);
5741 __tmp.put_u8(self.type_mask.bits());
5742 if matches!(version, MavlinkVersion::V2) {
5743 let len = __tmp.len();
5744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5745 } else {
5746 __tmp.len()
5747 }
5748 }
5749}
5750#[doc = "Motion capture attitude and position."]
5751#[doc = ""]
5752#[doc = "ID: 138"]
5753#[derive(Debug, Clone, PartialEq)]
5754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5756#[cfg_attr(feature = "ts", derive(TS))]
5757#[cfg_attr(feature = "ts", ts(export))]
5758pub struct ATT_POS_MOCAP_DATA {
5759 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5760 pub time_usec: u64,
5761 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5762 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5763 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5764 pub q: [f32; 4],
5765 #[doc = "X position (NED)"]
5766 pub x: f32,
5767 #[doc = "Y position (NED)"]
5768 pub y: f32,
5769 #[doc = "Z position (NED)"]
5770 pub z: f32,
5771 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5772 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5773 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5774 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5775 pub covariance: [f32; 21],
5776}
5777impl ATT_POS_MOCAP_DATA {
5778 pub const ENCODED_LEN: usize = 120usize;
5779 pub const DEFAULT: Self = Self {
5780 time_usec: 0_u64,
5781 q: [0.0_f32; 4usize],
5782 x: 0.0_f32,
5783 y: 0.0_f32,
5784 z: 0.0_f32,
5785 covariance: [0.0_f32; 21usize],
5786 };
5787 #[cfg(feature = "arbitrary")]
5788 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5789 use arbitrary::{Arbitrary, Unstructured};
5790 let mut buf = [0u8; 1024];
5791 rng.fill_bytes(&mut buf);
5792 let mut unstructured = Unstructured::new(&buf);
5793 Self::arbitrary(&mut unstructured).unwrap_or_default()
5794 }
5795}
5796impl Default for ATT_POS_MOCAP_DATA {
5797 fn default() -> Self {
5798 Self::DEFAULT.clone()
5799 }
5800}
5801impl MessageData for ATT_POS_MOCAP_DATA {
5802 type Message = MavMessage;
5803 const ID: u32 = 138u32;
5804 const NAME: &'static str = "ATT_POS_MOCAP";
5805 const EXTRA_CRC: u8 = 109u8;
5806 const ENCODED_LEN: usize = 120usize;
5807 fn deser(
5808 _version: MavlinkVersion,
5809 __input: &[u8],
5810 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5811 let avail_len = __input.len();
5812 let mut payload_buf = [0; Self::ENCODED_LEN];
5813 let mut buf = if avail_len < Self::ENCODED_LEN {
5814 payload_buf[0..avail_len].copy_from_slice(__input);
5815 Bytes::new(&payload_buf)
5816 } else {
5817 Bytes::new(__input)
5818 };
5819 let mut __struct = Self::default();
5820 __struct.time_usec = buf.get_u64_le();
5821 for v in &mut __struct.q {
5822 let val = buf.get_f32_le();
5823 *v = val;
5824 }
5825 __struct.x = buf.get_f32_le();
5826 __struct.y = buf.get_f32_le();
5827 __struct.z = buf.get_f32_le();
5828 for v in &mut __struct.covariance {
5829 let val = buf.get_f32_le();
5830 *v = val;
5831 }
5832 Ok(__struct)
5833 }
5834 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5835 let mut __tmp = BytesMut::new(bytes);
5836 #[allow(clippy::absurd_extreme_comparisons)]
5837 #[allow(unused_comparisons)]
5838 if __tmp.remaining() < Self::ENCODED_LEN {
5839 panic!(
5840 "buffer is too small (need {} bytes, but got {})",
5841 Self::ENCODED_LEN,
5842 __tmp.remaining(),
5843 )
5844 }
5845 __tmp.put_u64_le(self.time_usec);
5846 for val in &self.q {
5847 __tmp.put_f32_le(*val);
5848 }
5849 __tmp.put_f32_le(self.x);
5850 __tmp.put_f32_le(self.y);
5851 __tmp.put_f32_le(self.z);
5852 if matches!(version, MavlinkVersion::V2) {
5853 for val in &self.covariance {
5854 __tmp.put_f32_le(*val);
5855 }
5856 let len = __tmp.len();
5857 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5858 } else {
5859 __tmp.len()
5860 }
5861 }
5862}
5863#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5864#[doc = ""]
5865#[doc = "ID: 7"]
5866#[derive(Debug, Clone, PartialEq)]
5867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5869#[cfg_attr(feature = "ts", derive(TS))]
5870#[cfg_attr(feature = "ts", ts(export))]
5871pub struct AUTH_KEY_DATA {
5872 #[doc = "key"]
5873 #[cfg_attr(feature = "ts", ts(type = "string"))]
5874 pub key: CharArray<32>,
5875}
5876impl AUTH_KEY_DATA {
5877 pub const ENCODED_LEN: usize = 32usize;
5878 pub const DEFAULT: Self = Self {
5879 key: CharArray::new([0_u8; 32usize]),
5880 };
5881 #[cfg(feature = "arbitrary")]
5882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5883 use arbitrary::{Arbitrary, Unstructured};
5884 let mut buf = [0u8; 1024];
5885 rng.fill_bytes(&mut buf);
5886 let mut unstructured = Unstructured::new(&buf);
5887 Self::arbitrary(&mut unstructured).unwrap_or_default()
5888 }
5889}
5890impl Default for AUTH_KEY_DATA {
5891 fn default() -> Self {
5892 Self::DEFAULT.clone()
5893 }
5894}
5895impl MessageData for AUTH_KEY_DATA {
5896 type Message = MavMessage;
5897 const ID: u32 = 7u32;
5898 const NAME: &'static str = "AUTH_KEY";
5899 const EXTRA_CRC: u8 = 119u8;
5900 const ENCODED_LEN: usize = 32usize;
5901 fn deser(
5902 _version: MavlinkVersion,
5903 __input: &[u8],
5904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5905 let avail_len = __input.len();
5906 let mut payload_buf = [0; Self::ENCODED_LEN];
5907 let mut buf = if avail_len < Self::ENCODED_LEN {
5908 payload_buf[0..avail_len].copy_from_slice(__input);
5909 Bytes::new(&payload_buf)
5910 } else {
5911 Bytes::new(__input)
5912 };
5913 let mut __struct = Self::default();
5914 let mut tmp = [0_u8; 32usize];
5915 for v in &mut tmp {
5916 *v = buf.get_u8();
5917 }
5918 __struct.key = CharArray::new(tmp);
5919 Ok(__struct)
5920 }
5921 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5922 let mut __tmp = BytesMut::new(bytes);
5923 #[allow(clippy::absurd_extreme_comparisons)]
5924 #[allow(unused_comparisons)]
5925 if __tmp.remaining() < Self::ENCODED_LEN {
5926 panic!(
5927 "buffer is too small (need {} bytes, but got {})",
5928 Self::ENCODED_LEN,
5929 __tmp.remaining(),
5930 )
5931 }
5932 for val in &self.key {
5933 __tmp.put_u8(*val);
5934 }
5935 if matches!(version, MavlinkVersion::V2) {
5936 let len = __tmp.len();
5937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5938 } else {
5939 __tmp.len()
5940 }
5941 }
5942}
5943#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5944#[doc = ""]
5945#[doc = "ID: 286"]
5946#[derive(Debug, Clone, PartialEq)]
5947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5949#[cfg_attr(feature = "ts", derive(TS))]
5950#[cfg_attr(feature = "ts", ts(export))]
5951pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5952 #[doc = "Timestamp (time since system boot)."]
5953 pub time_boot_us: u64,
5954 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5955 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5956 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5957 pub q: [f32; 4],
5958 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5959 pub q_estimated_delay_us: u32,
5960 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5961 pub vx: f32,
5962 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5963 pub vy: f32,
5964 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5965 pub vz: f32,
5966 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5967 pub v_estimated_delay_us: u32,
5968 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5969 pub feed_forward_angular_velocity_z: f32,
5970 #[doc = "Bitmap indicating which estimator outputs are valid."]
5971 pub estimator_status: EstimatorStatusFlags,
5972 #[doc = "System ID"]
5973 pub target_system: u8,
5974 #[doc = "Component ID"]
5975 pub target_component: u8,
5976 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5977 pub landed_state: MavLandedState,
5978 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5980 pub angular_velocity_z: f32,
5981}
5982impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5983 pub const ENCODED_LEN: usize = 57usize;
5984 pub const DEFAULT: Self = Self {
5985 time_boot_us: 0_u64,
5986 q: [0.0_f32; 4usize],
5987 q_estimated_delay_us: 0_u32,
5988 vx: 0.0_f32,
5989 vy: 0.0_f32,
5990 vz: 0.0_f32,
5991 v_estimated_delay_us: 0_u32,
5992 feed_forward_angular_velocity_z: 0.0_f32,
5993 estimator_status: EstimatorStatusFlags::DEFAULT,
5994 target_system: 0_u8,
5995 target_component: 0_u8,
5996 landed_state: MavLandedState::DEFAULT,
5997 angular_velocity_z: 0.0_f32,
5998 };
5999 #[cfg(feature = "arbitrary")]
6000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6001 use arbitrary::{Arbitrary, Unstructured};
6002 let mut buf = [0u8; 1024];
6003 rng.fill_bytes(&mut buf);
6004 let mut unstructured = Unstructured::new(&buf);
6005 Self::arbitrary(&mut unstructured).unwrap_or_default()
6006 }
6007}
6008impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6009 fn default() -> Self {
6010 Self::DEFAULT.clone()
6011 }
6012}
6013impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6014 type Message = MavMessage;
6015 const ID: u32 = 286u32;
6016 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6017 const EXTRA_CRC: u8 = 210u8;
6018 const ENCODED_LEN: usize = 57usize;
6019 fn deser(
6020 _version: MavlinkVersion,
6021 __input: &[u8],
6022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6023 let avail_len = __input.len();
6024 let mut payload_buf = [0; Self::ENCODED_LEN];
6025 let mut buf = if avail_len < Self::ENCODED_LEN {
6026 payload_buf[0..avail_len].copy_from_slice(__input);
6027 Bytes::new(&payload_buf)
6028 } else {
6029 Bytes::new(__input)
6030 };
6031 let mut __struct = Self::default();
6032 __struct.time_boot_us = buf.get_u64_le();
6033 for v in &mut __struct.q {
6034 let val = buf.get_f32_le();
6035 *v = val;
6036 }
6037 __struct.q_estimated_delay_us = buf.get_u32_le();
6038 __struct.vx = buf.get_f32_le();
6039 __struct.vy = buf.get_f32_le();
6040 __struct.vz = buf.get_f32_le();
6041 __struct.v_estimated_delay_us = buf.get_u32_le();
6042 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6043 let tmp = buf.get_u16_le();
6044 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6045 tmp & EstimatorStatusFlags::all().bits(),
6046 )
6047 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6048 flag_type: "EstimatorStatusFlags",
6049 value: tmp as u32,
6050 })?;
6051 __struct.target_system = buf.get_u8();
6052 __struct.target_component = buf.get_u8();
6053 let tmp = buf.get_u8();
6054 __struct.landed_state =
6055 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6056 enum_type: "MavLandedState",
6057 value: tmp as u32,
6058 })?;
6059 __struct.angular_velocity_z = buf.get_f32_le();
6060 Ok(__struct)
6061 }
6062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6063 let mut __tmp = BytesMut::new(bytes);
6064 #[allow(clippy::absurd_extreme_comparisons)]
6065 #[allow(unused_comparisons)]
6066 if __tmp.remaining() < Self::ENCODED_LEN {
6067 panic!(
6068 "buffer is too small (need {} bytes, but got {})",
6069 Self::ENCODED_LEN,
6070 __tmp.remaining(),
6071 )
6072 }
6073 __tmp.put_u64_le(self.time_boot_us);
6074 for val in &self.q {
6075 __tmp.put_f32_le(*val);
6076 }
6077 __tmp.put_u32_le(self.q_estimated_delay_us);
6078 __tmp.put_f32_le(self.vx);
6079 __tmp.put_f32_le(self.vy);
6080 __tmp.put_f32_le(self.vz);
6081 __tmp.put_u32_le(self.v_estimated_delay_us);
6082 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6083 __tmp.put_u16_le(self.estimator_status.bits());
6084 __tmp.put_u8(self.target_system);
6085 __tmp.put_u8(self.target_component);
6086 __tmp.put_u8(self.landed_state as u8);
6087 if matches!(version, MavlinkVersion::V2) {
6088 __tmp.put_f32_le(self.angular_velocity_z);
6089 let len = __tmp.len();
6090 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6091 } else {
6092 __tmp.len()
6093 }
6094 }
6095}
6096#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6097#[doc = ""]
6098#[doc = "ID: 148"]
6099#[derive(Debug, Clone, PartialEq)]
6100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6102#[cfg_attr(feature = "ts", derive(TS))]
6103#[cfg_attr(feature = "ts", ts(export))]
6104pub struct AUTOPILOT_VERSION_DATA {
6105 #[doc = "Bitmap of capabilities"]
6106 pub capabilities: MavProtocolCapability,
6107 #[doc = "UID if provided by hardware (see uid2)"]
6108 pub uid: u64,
6109 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6110 pub flight_sw_version: u32,
6111 #[doc = "Middleware version number"]
6112 pub middleware_sw_version: u32,
6113 #[doc = "Operating system version number"]
6114 pub os_sw_version: u32,
6115 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6116 pub board_version: u32,
6117 #[doc = "ID of the board vendor"]
6118 pub vendor_id: u16,
6119 #[doc = "ID of the product"]
6120 pub product_id: u16,
6121 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6122 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6123 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6124 pub flight_custom_version: [u8; 8],
6125 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6126 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6127 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6128 pub middleware_custom_version: [u8; 8],
6129 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6130 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6131 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6132 pub os_custom_version: [u8; 8],
6133 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6134 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6135 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6136 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6137 pub uid2: [u8; 18],
6138}
6139impl AUTOPILOT_VERSION_DATA {
6140 pub const ENCODED_LEN: usize = 78usize;
6141 pub const DEFAULT: Self = Self {
6142 capabilities: MavProtocolCapability::DEFAULT,
6143 uid: 0_u64,
6144 flight_sw_version: 0_u32,
6145 middleware_sw_version: 0_u32,
6146 os_sw_version: 0_u32,
6147 board_version: 0_u32,
6148 vendor_id: 0_u16,
6149 product_id: 0_u16,
6150 flight_custom_version: [0_u8; 8usize],
6151 middleware_custom_version: [0_u8; 8usize],
6152 os_custom_version: [0_u8; 8usize],
6153 uid2: [0_u8; 18usize],
6154 };
6155 #[cfg(feature = "arbitrary")]
6156 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6157 use arbitrary::{Arbitrary, Unstructured};
6158 let mut buf = [0u8; 1024];
6159 rng.fill_bytes(&mut buf);
6160 let mut unstructured = Unstructured::new(&buf);
6161 Self::arbitrary(&mut unstructured).unwrap_or_default()
6162 }
6163}
6164impl Default for AUTOPILOT_VERSION_DATA {
6165 fn default() -> Self {
6166 Self::DEFAULT.clone()
6167 }
6168}
6169impl MessageData for AUTOPILOT_VERSION_DATA {
6170 type Message = MavMessage;
6171 const ID: u32 = 148u32;
6172 const NAME: &'static str = "AUTOPILOT_VERSION";
6173 const EXTRA_CRC: u8 = 178u8;
6174 const ENCODED_LEN: usize = 78usize;
6175 fn deser(
6176 _version: MavlinkVersion,
6177 __input: &[u8],
6178 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6179 let avail_len = __input.len();
6180 let mut payload_buf = [0; Self::ENCODED_LEN];
6181 let mut buf = if avail_len < Self::ENCODED_LEN {
6182 payload_buf[0..avail_len].copy_from_slice(__input);
6183 Bytes::new(&payload_buf)
6184 } else {
6185 Bytes::new(__input)
6186 };
6187 let mut __struct = Self::default();
6188 let tmp = buf.get_u64_le();
6189 __struct.capabilities = MavProtocolCapability::from_bits(
6190 tmp & MavProtocolCapability::all().bits(),
6191 )
6192 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6193 flag_type: "MavProtocolCapability",
6194 value: tmp as u32,
6195 })?;
6196 __struct.uid = buf.get_u64_le();
6197 __struct.flight_sw_version = buf.get_u32_le();
6198 __struct.middleware_sw_version = buf.get_u32_le();
6199 __struct.os_sw_version = buf.get_u32_le();
6200 __struct.board_version = buf.get_u32_le();
6201 __struct.vendor_id = buf.get_u16_le();
6202 __struct.product_id = buf.get_u16_le();
6203 for v in &mut __struct.flight_custom_version {
6204 let val = buf.get_u8();
6205 *v = val;
6206 }
6207 for v in &mut __struct.middleware_custom_version {
6208 let val = buf.get_u8();
6209 *v = val;
6210 }
6211 for v in &mut __struct.os_custom_version {
6212 let val = buf.get_u8();
6213 *v = val;
6214 }
6215 for v in &mut __struct.uid2 {
6216 let val = buf.get_u8();
6217 *v = val;
6218 }
6219 Ok(__struct)
6220 }
6221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6222 let mut __tmp = BytesMut::new(bytes);
6223 #[allow(clippy::absurd_extreme_comparisons)]
6224 #[allow(unused_comparisons)]
6225 if __tmp.remaining() < Self::ENCODED_LEN {
6226 panic!(
6227 "buffer is too small (need {} bytes, but got {})",
6228 Self::ENCODED_LEN,
6229 __tmp.remaining(),
6230 )
6231 }
6232 __tmp.put_u64_le(self.capabilities.bits());
6233 __tmp.put_u64_le(self.uid);
6234 __tmp.put_u32_le(self.flight_sw_version);
6235 __tmp.put_u32_le(self.middleware_sw_version);
6236 __tmp.put_u32_le(self.os_sw_version);
6237 __tmp.put_u32_le(self.board_version);
6238 __tmp.put_u16_le(self.vendor_id);
6239 __tmp.put_u16_le(self.product_id);
6240 for val in &self.flight_custom_version {
6241 __tmp.put_u8(*val);
6242 }
6243 for val in &self.middleware_custom_version {
6244 __tmp.put_u8(*val);
6245 }
6246 for val in &self.os_custom_version {
6247 __tmp.put_u8(*val);
6248 }
6249 if matches!(version, MavlinkVersion::V2) {
6250 for val in &self.uid2 {
6251 __tmp.put_u8(*val);
6252 }
6253 let len = __tmp.len();
6254 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6255 } else {
6256 __tmp.len()
6257 }
6258 }
6259}
6260#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6261#[doc = ""]
6262#[doc = "ID: 435"]
6263#[derive(Debug, Clone, PartialEq)]
6264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6266#[cfg_attr(feature = "ts", derive(TS))]
6267#[cfg_attr(feature = "ts", ts(export))]
6268pub struct AVAILABLE_MODES_DATA {
6269 #[doc = "A bitfield for use for autopilot-specific flags"]
6270 pub custom_mode: u32,
6271 #[doc = "Mode properties."]
6272 pub properties: MavModeProperty,
6273 #[doc = "The total number of available modes for the current vehicle type."]
6274 pub number_modes: u8,
6275 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6276 pub mode_index: u8,
6277 #[doc = "Standard mode."]
6278 pub standard_mode: MavStandardMode,
6279 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6280 #[cfg_attr(feature = "ts", ts(type = "string"))]
6281 pub mode_name: CharArray<35>,
6282}
6283impl AVAILABLE_MODES_DATA {
6284 pub const ENCODED_LEN: usize = 46usize;
6285 pub const DEFAULT: Self = Self {
6286 custom_mode: 0_u32,
6287 properties: MavModeProperty::DEFAULT,
6288 number_modes: 0_u8,
6289 mode_index: 0_u8,
6290 standard_mode: MavStandardMode::DEFAULT,
6291 mode_name: CharArray::new([0_u8; 35usize]),
6292 };
6293 #[cfg(feature = "arbitrary")]
6294 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6295 use arbitrary::{Arbitrary, Unstructured};
6296 let mut buf = [0u8; 1024];
6297 rng.fill_bytes(&mut buf);
6298 let mut unstructured = Unstructured::new(&buf);
6299 Self::arbitrary(&mut unstructured).unwrap_or_default()
6300 }
6301}
6302impl Default for AVAILABLE_MODES_DATA {
6303 fn default() -> Self {
6304 Self::DEFAULT.clone()
6305 }
6306}
6307impl MessageData for AVAILABLE_MODES_DATA {
6308 type Message = MavMessage;
6309 const ID: u32 = 435u32;
6310 const NAME: &'static str = "AVAILABLE_MODES";
6311 const EXTRA_CRC: u8 = 134u8;
6312 const ENCODED_LEN: usize = 46usize;
6313 fn deser(
6314 _version: MavlinkVersion,
6315 __input: &[u8],
6316 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6317 let avail_len = __input.len();
6318 let mut payload_buf = [0; Self::ENCODED_LEN];
6319 let mut buf = if avail_len < Self::ENCODED_LEN {
6320 payload_buf[0..avail_len].copy_from_slice(__input);
6321 Bytes::new(&payload_buf)
6322 } else {
6323 Bytes::new(__input)
6324 };
6325 let mut __struct = Self::default();
6326 __struct.custom_mode = buf.get_u32_le();
6327 let tmp = buf.get_u32_le();
6328 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6329 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6330 flag_type: "MavModeProperty",
6331 value: tmp as u32,
6332 })?;
6333 __struct.number_modes = buf.get_u8();
6334 __struct.mode_index = buf.get_u8();
6335 let tmp = buf.get_u8();
6336 __struct.standard_mode =
6337 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6338 enum_type: "MavStandardMode",
6339 value: tmp as u32,
6340 })?;
6341 let mut tmp = [0_u8; 35usize];
6342 for v in &mut tmp {
6343 *v = buf.get_u8();
6344 }
6345 __struct.mode_name = CharArray::new(tmp);
6346 Ok(__struct)
6347 }
6348 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6349 let mut __tmp = BytesMut::new(bytes);
6350 #[allow(clippy::absurd_extreme_comparisons)]
6351 #[allow(unused_comparisons)]
6352 if __tmp.remaining() < Self::ENCODED_LEN {
6353 panic!(
6354 "buffer is too small (need {} bytes, but got {})",
6355 Self::ENCODED_LEN,
6356 __tmp.remaining(),
6357 )
6358 }
6359 __tmp.put_u32_le(self.custom_mode);
6360 __tmp.put_u32_le(self.properties.bits());
6361 __tmp.put_u8(self.number_modes);
6362 __tmp.put_u8(self.mode_index);
6363 __tmp.put_u8(self.standard_mode as u8);
6364 for val in &self.mode_name {
6365 __tmp.put_u8(*val);
6366 }
6367 if matches!(version, MavlinkVersion::V2) {
6368 let len = __tmp.len();
6369 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6370 } else {
6371 __tmp.len()
6372 }
6373 }
6374}
6375#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6376#[doc = ""]
6377#[doc = "ID: 437"]
6378#[derive(Debug, Clone, PartialEq)]
6379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6381#[cfg_attr(feature = "ts", derive(TS))]
6382#[cfg_attr(feature = "ts", ts(export))]
6383pub struct AVAILABLE_MODES_MONITOR_DATA {
6384 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6385 pub seq: u8,
6386}
6387impl AVAILABLE_MODES_MONITOR_DATA {
6388 pub const ENCODED_LEN: usize = 1usize;
6389 pub const DEFAULT: Self = Self { seq: 0_u8 };
6390 #[cfg(feature = "arbitrary")]
6391 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6392 use arbitrary::{Arbitrary, Unstructured};
6393 let mut buf = [0u8; 1024];
6394 rng.fill_bytes(&mut buf);
6395 let mut unstructured = Unstructured::new(&buf);
6396 Self::arbitrary(&mut unstructured).unwrap_or_default()
6397 }
6398}
6399impl Default for AVAILABLE_MODES_MONITOR_DATA {
6400 fn default() -> Self {
6401 Self::DEFAULT.clone()
6402 }
6403}
6404impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6405 type Message = MavMessage;
6406 const ID: u32 = 437u32;
6407 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6408 const EXTRA_CRC: u8 = 30u8;
6409 const ENCODED_LEN: usize = 1usize;
6410 fn deser(
6411 _version: MavlinkVersion,
6412 __input: &[u8],
6413 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6414 let avail_len = __input.len();
6415 let mut payload_buf = [0; Self::ENCODED_LEN];
6416 let mut buf = if avail_len < Self::ENCODED_LEN {
6417 payload_buf[0..avail_len].copy_from_slice(__input);
6418 Bytes::new(&payload_buf)
6419 } else {
6420 Bytes::new(__input)
6421 };
6422 let mut __struct = Self::default();
6423 __struct.seq = buf.get_u8();
6424 Ok(__struct)
6425 }
6426 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6427 let mut __tmp = BytesMut::new(bytes);
6428 #[allow(clippy::absurd_extreme_comparisons)]
6429 #[allow(unused_comparisons)]
6430 if __tmp.remaining() < Self::ENCODED_LEN {
6431 panic!(
6432 "buffer is too small (need {} bytes, but got {})",
6433 Self::ENCODED_LEN,
6434 __tmp.remaining(),
6435 )
6436 }
6437 __tmp.put_u8(self.seq);
6438 if matches!(version, MavlinkVersion::V2) {
6439 let len = __tmp.len();
6440 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6441 } else {
6442 __tmp.len()
6443 }
6444 }
6445}
6446#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6447#[doc = ""]
6448#[doc = "ID: 372"]
6449#[derive(Debug, Clone, PartialEq)]
6450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6452#[cfg_attr(feature = "ts", derive(TS))]
6453#[cfg_attr(feature = "ts", ts(export))]
6454pub struct BATTERY_INFO_DATA {
6455 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6456 pub discharge_minimum_voltage: f32,
6457 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6458 pub charging_minimum_voltage: f32,
6459 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6460 pub resting_minimum_voltage: f32,
6461 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6462 pub charging_maximum_voltage: f32,
6463 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6464 pub charging_maximum_current: f32,
6465 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6466 pub nominal_voltage: f32,
6467 #[doc = "Maximum pack discharge current. 0: field not provided."]
6468 pub discharge_maximum_current: f32,
6469 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6470 pub discharge_maximum_burst_current: f32,
6471 #[doc = "Fully charged design capacity. 0: field not provided."]
6472 pub design_capacity: f32,
6473 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6474 pub full_charge_capacity: f32,
6475 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6476 pub cycle_count: u16,
6477 #[doc = "Battery weight. 0: field not provided."]
6478 pub weight: u16,
6479 #[doc = "Battery ID"]
6480 pub id: u8,
6481 #[doc = "Function of the battery."]
6482 pub battery_function: MavBatteryFunction,
6483 #[doc = "Type (chemistry) of the battery."]
6484 pub mavtype: MavBatteryType,
6485 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6486 pub state_of_health: u8,
6487 #[doc = "Number of battery cells in series. 0: field not provided."]
6488 pub cells_in_series: u8,
6489 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6490 #[cfg_attr(feature = "ts", ts(type = "string"))]
6491 pub manufacture_date: CharArray<9>,
6492 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6493 #[cfg_attr(feature = "ts", ts(type = "string"))]
6494 pub serial_number: CharArray<32>,
6495 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6496 #[cfg_attr(feature = "ts", ts(type = "string"))]
6497 pub name: CharArray<50>,
6498}
6499impl BATTERY_INFO_DATA {
6500 pub const ENCODED_LEN: usize = 140usize;
6501 pub const DEFAULT: Self = Self {
6502 discharge_minimum_voltage: 0.0_f32,
6503 charging_minimum_voltage: 0.0_f32,
6504 resting_minimum_voltage: 0.0_f32,
6505 charging_maximum_voltage: 0.0_f32,
6506 charging_maximum_current: 0.0_f32,
6507 nominal_voltage: 0.0_f32,
6508 discharge_maximum_current: 0.0_f32,
6509 discharge_maximum_burst_current: 0.0_f32,
6510 design_capacity: 0.0_f32,
6511 full_charge_capacity: 0.0_f32,
6512 cycle_count: 0_u16,
6513 weight: 0_u16,
6514 id: 0_u8,
6515 battery_function: MavBatteryFunction::DEFAULT,
6516 mavtype: MavBatteryType::DEFAULT,
6517 state_of_health: 0_u8,
6518 cells_in_series: 0_u8,
6519 manufacture_date: CharArray::new([0_u8; 9usize]),
6520 serial_number: CharArray::new([0_u8; 32usize]),
6521 name: CharArray::new([0_u8; 50usize]),
6522 };
6523 #[cfg(feature = "arbitrary")]
6524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6525 use arbitrary::{Arbitrary, Unstructured};
6526 let mut buf = [0u8; 1024];
6527 rng.fill_bytes(&mut buf);
6528 let mut unstructured = Unstructured::new(&buf);
6529 Self::arbitrary(&mut unstructured).unwrap_or_default()
6530 }
6531}
6532impl Default for BATTERY_INFO_DATA {
6533 fn default() -> Self {
6534 Self::DEFAULT.clone()
6535 }
6536}
6537impl MessageData for BATTERY_INFO_DATA {
6538 type Message = MavMessage;
6539 const ID: u32 = 372u32;
6540 const NAME: &'static str = "BATTERY_INFO";
6541 const EXTRA_CRC: u8 = 26u8;
6542 const ENCODED_LEN: usize = 140usize;
6543 fn deser(
6544 _version: MavlinkVersion,
6545 __input: &[u8],
6546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6547 let avail_len = __input.len();
6548 let mut payload_buf = [0; Self::ENCODED_LEN];
6549 let mut buf = if avail_len < Self::ENCODED_LEN {
6550 payload_buf[0..avail_len].copy_from_slice(__input);
6551 Bytes::new(&payload_buf)
6552 } else {
6553 Bytes::new(__input)
6554 };
6555 let mut __struct = Self::default();
6556 __struct.discharge_minimum_voltage = buf.get_f32_le();
6557 __struct.charging_minimum_voltage = buf.get_f32_le();
6558 __struct.resting_minimum_voltage = buf.get_f32_le();
6559 __struct.charging_maximum_voltage = buf.get_f32_le();
6560 __struct.charging_maximum_current = buf.get_f32_le();
6561 __struct.nominal_voltage = buf.get_f32_le();
6562 __struct.discharge_maximum_current = buf.get_f32_le();
6563 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6564 __struct.design_capacity = buf.get_f32_le();
6565 __struct.full_charge_capacity = buf.get_f32_le();
6566 __struct.cycle_count = buf.get_u16_le();
6567 __struct.weight = buf.get_u16_le();
6568 __struct.id = buf.get_u8();
6569 let tmp = buf.get_u8();
6570 __struct.battery_function =
6571 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6572 enum_type: "MavBatteryFunction",
6573 value: tmp as u32,
6574 })?;
6575 let tmp = buf.get_u8();
6576 __struct.mavtype =
6577 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6578 enum_type: "MavBatteryType",
6579 value: tmp as u32,
6580 })?;
6581 __struct.state_of_health = buf.get_u8();
6582 __struct.cells_in_series = buf.get_u8();
6583 let mut tmp = [0_u8; 9usize];
6584 for v in &mut tmp {
6585 *v = buf.get_u8();
6586 }
6587 __struct.manufacture_date = CharArray::new(tmp);
6588 let mut tmp = [0_u8; 32usize];
6589 for v in &mut tmp {
6590 *v = buf.get_u8();
6591 }
6592 __struct.serial_number = CharArray::new(tmp);
6593 let mut tmp = [0_u8; 50usize];
6594 for v in &mut tmp {
6595 *v = buf.get_u8();
6596 }
6597 __struct.name = CharArray::new(tmp);
6598 Ok(__struct)
6599 }
6600 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6601 let mut __tmp = BytesMut::new(bytes);
6602 #[allow(clippy::absurd_extreme_comparisons)]
6603 #[allow(unused_comparisons)]
6604 if __tmp.remaining() < Self::ENCODED_LEN {
6605 panic!(
6606 "buffer is too small (need {} bytes, but got {})",
6607 Self::ENCODED_LEN,
6608 __tmp.remaining(),
6609 )
6610 }
6611 __tmp.put_f32_le(self.discharge_minimum_voltage);
6612 __tmp.put_f32_le(self.charging_minimum_voltage);
6613 __tmp.put_f32_le(self.resting_minimum_voltage);
6614 __tmp.put_f32_le(self.charging_maximum_voltage);
6615 __tmp.put_f32_le(self.charging_maximum_current);
6616 __tmp.put_f32_le(self.nominal_voltage);
6617 __tmp.put_f32_le(self.discharge_maximum_current);
6618 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6619 __tmp.put_f32_le(self.design_capacity);
6620 __tmp.put_f32_le(self.full_charge_capacity);
6621 __tmp.put_u16_le(self.cycle_count);
6622 __tmp.put_u16_le(self.weight);
6623 __tmp.put_u8(self.id);
6624 __tmp.put_u8(self.battery_function as u8);
6625 __tmp.put_u8(self.mavtype as u8);
6626 __tmp.put_u8(self.state_of_health);
6627 __tmp.put_u8(self.cells_in_series);
6628 for val in &self.manufacture_date {
6629 __tmp.put_u8(*val);
6630 }
6631 for val in &self.serial_number {
6632 __tmp.put_u8(*val);
6633 }
6634 for val in &self.name {
6635 __tmp.put_u8(*val);
6636 }
6637 if matches!(version, MavlinkVersion::V2) {
6638 let len = __tmp.len();
6639 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6640 } else {
6641 __tmp.len()
6642 }
6643 }
6644}
6645#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6646#[doc = ""]
6647#[doc = "ID: 147"]
6648#[derive(Debug, Clone, PartialEq)]
6649#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6651#[cfg_attr(feature = "ts", derive(TS))]
6652#[cfg_attr(feature = "ts", ts(export))]
6653pub struct BATTERY_STATUS_DATA {
6654 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6655 pub current_consumed: i32,
6656 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6657 pub energy_consumed: i32,
6658 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6659 pub temperature: i16,
6660 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6661 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6662 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6663 pub voltages: [u16; 10],
6664 #[doc = "Battery current, -1: autopilot does not measure the current"]
6665 pub current_battery: i16,
6666 #[doc = "Battery ID"]
6667 pub id: u8,
6668 #[doc = "Function of the battery"]
6669 pub battery_function: MavBatteryFunction,
6670 #[doc = "Type (chemistry) of the battery"]
6671 pub mavtype: MavBatteryType,
6672 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6673 pub battery_remaining: i8,
6674 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6675 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6676 pub time_remaining: i32,
6677 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6678 #[cfg_attr(feature = "serde", serde(default))]
6679 pub charge_state: MavBatteryChargeState,
6680 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6681 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6683 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6684 pub voltages_ext: [u16; 4],
6685 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6686 #[cfg_attr(feature = "serde", serde(default))]
6687 pub mode: MavBatteryMode,
6688 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6689 #[cfg_attr(feature = "serde", serde(default))]
6690 pub fault_bitmask: MavBatteryFault,
6691}
6692impl BATTERY_STATUS_DATA {
6693 pub const ENCODED_LEN: usize = 54usize;
6694 pub const DEFAULT: Self = Self {
6695 current_consumed: 0_i32,
6696 energy_consumed: 0_i32,
6697 temperature: 0_i16,
6698 voltages: [0_u16; 10usize],
6699 current_battery: 0_i16,
6700 id: 0_u8,
6701 battery_function: MavBatteryFunction::DEFAULT,
6702 mavtype: MavBatteryType::DEFAULT,
6703 battery_remaining: 0_i8,
6704 time_remaining: 0_i32,
6705 charge_state: MavBatteryChargeState::DEFAULT,
6706 voltages_ext: [0_u16; 4usize],
6707 mode: MavBatteryMode::DEFAULT,
6708 fault_bitmask: MavBatteryFault::DEFAULT,
6709 };
6710 #[cfg(feature = "arbitrary")]
6711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6712 use arbitrary::{Arbitrary, Unstructured};
6713 let mut buf = [0u8; 1024];
6714 rng.fill_bytes(&mut buf);
6715 let mut unstructured = Unstructured::new(&buf);
6716 Self::arbitrary(&mut unstructured).unwrap_or_default()
6717 }
6718}
6719impl Default for BATTERY_STATUS_DATA {
6720 fn default() -> Self {
6721 Self::DEFAULT.clone()
6722 }
6723}
6724impl MessageData for BATTERY_STATUS_DATA {
6725 type Message = MavMessage;
6726 const ID: u32 = 147u32;
6727 const NAME: &'static str = "BATTERY_STATUS";
6728 const EXTRA_CRC: u8 = 154u8;
6729 const ENCODED_LEN: usize = 54usize;
6730 fn deser(
6731 _version: MavlinkVersion,
6732 __input: &[u8],
6733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6734 let avail_len = __input.len();
6735 let mut payload_buf = [0; Self::ENCODED_LEN];
6736 let mut buf = if avail_len < Self::ENCODED_LEN {
6737 payload_buf[0..avail_len].copy_from_slice(__input);
6738 Bytes::new(&payload_buf)
6739 } else {
6740 Bytes::new(__input)
6741 };
6742 let mut __struct = Self::default();
6743 __struct.current_consumed = buf.get_i32_le();
6744 __struct.energy_consumed = buf.get_i32_le();
6745 __struct.temperature = buf.get_i16_le();
6746 for v in &mut __struct.voltages {
6747 let val = buf.get_u16_le();
6748 *v = val;
6749 }
6750 __struct.current_battery = buf.get_i16_le();
6751 __struct.id = buf.get_u8();
6752 let tmp = buf.get_u8();
6753 __struct.battery_function =
6754 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6755 enum_type: "MavBatteryFunction",
6756 value: tmp as u32,
6757 })?;
6758 let tmp = buf.get_u8();
6759 __struct.mavtype =
6760 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6761 enum_type: "MavBatteryType",
6762 value: tmp as u32,
6763 })?;
6764 __struct.battery_remaining = buf.get_i8();
6765 __struct.time_remaining = buf.get_i32_le();
6766 let tmp = buf.get_u8();
6767 __struct.charge_state =
6768 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6769 enum_type: "MavBatteryChargeState",
6770 value: tmp as u32,
6771 })?;
6772 for v in &mut __struct.voltages_ext {
6773 let val = buf.get_u16_le();
6774 *v = val;
6775 }
6776 let tmp = buf.get_u8();
6777 __struct.mode =
6778 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6779 enum_type: "MavBatteryMode",
6780 value: tmp as u32,
6781 })?;
6782 let tmp = buf.get_u32_le();
6783 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6784 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6785 flag_type: "MavBatteryFault",
6786 value: tmp as u32,
6787 })?;
6788 Ok(__struct)
6789 }
6790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6791 let mut __tmp = BytesMut::new(bytes);
6792 #[allow(clippy::absurd_extreme_comparisons)]
6793 #[allow(unused_comparisons)]
6794 if __tmp.remaining() < Self::ENCODED_LEN {
6795 panic!(
6796 "buffer is too small (need {} bytes, but got {})",
6797 Self::ENCODED_LEN,
6798 __tmp.remaining(),
6799 )
6800 }
6801 __tmp.put_i32_le(self.current_consumed);
6802 __tmp.put_i32_le(self.energy_consumed);
6803 __tmp.put_i16_le(self.temperature);
6804 for val in &self.voltages {
6805 __tmp.put_u16_le(*val);
6806 }
6807 __tmp.put_i16_le(self.current_battery);
6808 __tmp.put_u8(self.id);
6809 __tmp.put_u8(self.battery_function as u8);
6810 __tmp.put_u8(self.mavtype as u8);
6811 __tmp.put_i8(self.battery_remaining);
6812 if matches!(version, MavlinkVersion::V2) {
6813 __tmp.put_i32_le(self.time_remaining);
6814 __tmp.put_u8(self.charge_state as u8);
6815 for val in &self.voltages_ext {
6816 __tmp.put_u16_le(*val);
6817 }
6818 __tmp.put_u8(self.mode as u8);
6819 __tmp.put_u32_le(self.fault_bitmask.bits());
6820 let len = __tmp.len();
6821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6822 } else {
6823 __tmp.len()
6824 }
6825 }
6826}
6827#[doc = "Report button state change."]
6828#[doc = ""]
6829#[doc = "ID: 257"]
6830#[derive(Debug, Clone, PartialEq)]
6831#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6832#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6833#[cfg_attr(feature = "ts", derive(TS))]
6834#[cfg_attr(feature = "ts", ts(export))]
6835pub struct BUTTON_CHANGE_DATA {
6836 #[doc = "Timestamp (time since system boot)."]
6837 pub time_boot_ms: u32,
6838 #[doc = "Time of last change of button state."]
6839 pub last_change_ms: u32,
6840 #[doc = "Bitmap for state of buttons."]
6841 pub state: u8,
6842}
6843impl BUTTON_CHANGE_DATA {
6844 pub const ENCODED_LEN: usize = 9usize;
6845 pub const DEFAULT: Self = Self {
6846 time_boot_ms: 0_u32,
6847 last_change_ms: 0_u32,
6848 state: 0_u8,
6849 };
6850 #[cfg(feature = "arbitrary")]
6851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6852 use arbitrary::{Arbitrary, Unstructured};
6853 let mut buf = [0u8; 1024];
6854 rng.fill_bytes(&mut buf);
6855 let mut unstructured = Unstructured::new(&buf);
6856 Self::arbitrary(&mut unstructured).unwrap_or_default()
6857 }
6858}
6859impl Default for BUTTON_CHANGE_DATA {
6860 fn default() -> Self {
6861 Self::DEFAULT.clone()
6862 }
6863}
6864impl MessageData for BUTTON_CHANGE_DATA {
6865 type Message = MavMessage;
6866 const ID: u32 = 257u32;
6867 const NAME: &'static str = "BUTTON_CHANGE";
6868 const EXTRA_CRC: u8 = 131u8;
6869 const ENCODED_LEN: usize = 9usize;
6870 fn deser(
6871 _version: MavlinkVersion,
6872 __input: &[u8],
6873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6874 let avail_len = __input.len();
6875 let mut payload_buf = [0; Self::ENCODED_LEN];
6876 let mut buf = if avail_len < Self::ENCODED_LEN {
6877 payload_buf[0..avail_len].copy_from_slice(__input);
6878 Bytes::new(&payload_buf)
6879 } else {
6880 Bytes::new(__input)
6881 };
6882 let mut __struct = Self::default();
6883 __struct.time_boot_ms = buf.get_u32_le();
6884 __struct.last_change_ms = buf.get_u32_le();
6885 __struct.state = buf.get_u8();
6886 Ok(__struct)
6887 }
6888 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6889 let mut __tmp = BytesMut::new(bytes);
6890 #[allow(clippy::absurd_extreme_comparisons)]
6891 #[allow(unused_comparisons)]
6892 if __tmp.remaining() < Self::ENCODED_LEN {
6893 panic!(
6894 "buffer is too small (need {} bytes, but got {})",
6895 Self::ENCODED_LEN,
6896 __tmp.remaining(),
6897 )
6898 }
6899 __tmp.put_u32_le(self.time_boot_ms);
6900 __tmp.put_u32_le(self.last_change_ms);
6901 __tmp.put_u8(self.state);
6902 if matches!(version, MavlinkVersion::V2) {
6903 let len = __tmp.len();
6904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6905 } else {
6906 __tmp.len()
6907 }
6908 }
6909}
6910#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6911#[doc = ""]
6912#[doc = "ID: 262"]
6913#[derive(Debug, Clone, PartialEq)]
6914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6916#[cfg_attr(feature = "ts", derive(TS))]
6917#[cfg_attr(feature = "ts", ts(export))]
6918pub struct CAMERA_CAPTURE_STATUS_DATA {
6919 #[doc = "Timestamp (time since system boot)."]
6920 pub time_boot_ms: u32,
6921 #[doc = "Image capture interval"]
6922 pub image_interval: f32,
6923 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6924 pub recording_time_ms: u32,
6925 #[doc = "Available storage capacity."]
6926 pub available_capacity: f32,
6927 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6928 pub image_status: u8,
6929 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6930 pub video_status: u8,
6931 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6932 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6933 pub image_count: i32,
6934 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6935 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6936 pub camera_device_id: u8,
6937}
6938impl CAMERA_CAPTURE_STATUS_DATA {
6939 pub const ENCODED_LEN: usize = 23usize;
6940 pub const DEFAULT: Self = Self {
6941 time_boot_ms: 0_u32,
6942 image_interval: 0.0_f32,
6943 recording_time_ms: 0_u32,
6944 available_capacity: 0.0_f32,
6945 image_status: 0_u8,
6946 video_status: 0_u8,
6947 image_count: 0_i32,
6948 camera_device_id: 0_u8,
6949 };
6950 #[cfg(feature = "arbitrary")]
6951 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6952 use arbitrary::{Arbitrary, Unstructured};
6953 let mut buf = [0u8; 1024];
6954 rng.fill_bytes(&mut buf);
6955 let mut unstructured = Unstructured::new(&buf);
6956 Self::arbitrary(&mut unstructured).unwrap_or_default()
6957 }
6958}
6959impl Default for CAMERA_CAPTURE_STATUS_DATA {
6960 fn default() -> Self {
6961 Self::DEFAULT.clone()
6962 }
6963}
6964impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6965 type Message = MavMessage;
6966 const ID: u32 = 262u32;
6967 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6968 const EXTRA_CRC: u8 = 12u8;
6969 const ENCODED_LEN: usize = 23usize;
6970 fn deser(
6971 _version: MavlinkVersion,
6972 __input: &[u8],
6973 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6974 let avail_len = __input.len();
6975 let mut payload_buf = [0; Self::ENCODED_LEN];
6976 let mut buf = if avail_len < Self::ENCODED_LEN {
6977 payload_buf[0..avail_len].copy_from_slice(__input);
6978 Bytes::new(&payload_buf)
6979 } else {
6980 Bytes::new(__input)
6981 };
6982 let mut __struct = Self::default();
6983 __struct.time_boot_ms = buf.get_u32_le();
6984 __struct.image_interval = buf.get_f32_le();
6985 __struct.recording_time_ms = buf.get_u32_le();
6986 __struct.available_capacity = buf.get_f32_le();
6987 __struct.image_status = buf.get_u8();
6988 __struct.video_status = buf.get_u8();
6989 __struct.image_count = buf.get_i32_le();
6990 __struct.camera_device_id = buf.get_u8();
6991 Ok(__struct)
6992 }
6993 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6994 let mut __tmp = BytesMut::new(bytes);
6995 #[allow(clippy::absurd_extreme_comparisons)]
6996 #[allow(unused_comparisons)]
6997 if __tmp.remaining() < Self::ENCODED_LEN {
6998 panic!(
6999 "buffer is too small (need {} bytes, but got {})",
7000 Self::ENCODED_LEN,
7001 __tmp.remaining(),
7002 )
7003 }
7004 __tmp.put_u32_le(self.time_boot_ms);
7005 __tmp.put_f32_le(self.image_interval);
7006 __tmp.put_u32_le(self.recording_time_ms);
7007 __tmp.put_f32_le(self.available_capacity);
7008 __tmp.put_u8(self.image_status);
7009 __tmp.put_u8(self.video_status);
7010 if matches!(version, MavlinkVersion::V2) {
7011 __tmp.put_i32_le(self.image_count);
7012 __tmp.put_u8(self.camera_device_id);
7013 let len = __tmp.len();
7014 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7015 } else {
7016 __tmp.len()
7017 }
7018 }
7019}
7020#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7021#[doc = ""]
7022#[doc = "ID: 271"]
7023#[derive(Debug, Clone, PartialEq)]
7024#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7025#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7026#[cfg_attr(feature = "ts", derive(TS))]
7027#[cfg_attr(feature = "ts", ts(export))]
7028pub struct CAMERA_FOV_STATUS_DATA {
7029 #[doc = "Timestamp (time since system boot)."]
7030 pub time_boot_ms: u32,
7031 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7032 pub lat_camera: i32,
7033 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7034 pub lon_camera: i32,
7035 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7036 pub alt_camera: i32,
7037 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7038 pub lat_image: i32,
7039 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7040 pub lon_image: i32,
7041 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7042 pub alt_image: i32,
7043 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7045 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7046 pub q: [f32; 4],
7047 #[doc = "Horizontal field of view (NaN if unknown)."]
7048 pub hfov: f32,
7049 #[doc = "Vertical field of view (NaN if unknown)."]
7050 pub vfov: f32,
7051 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7052 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7053 pub camera_device_id: u8,
7054}
7055impl CAMERA_FOV_STATUS_DATA {
7056 pub const ENCODED_LEN: usize = 53usize;
7057 pub const DEFAULT: Self = Self {
7058 time_boot_ms: 0_u32,
7059 lat_camera: 0_i32,
7060 lon_camera: 0_i32,
7061 alt_camera: 0_i32,
7062 lat_image: 0_i32,
7063 lon_image: 0_i32,
7064 alt_image: 0_i32,
7065 q: [0.0_f32; 4usize],
7066 hfov: 0.0_f32,
7067 vfov: 0.0_f32,
7068 camera_device_id: 0_u8,
7069 };
7070 #[cfg(feature = "arbitrary")]
7071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7072 use arbitrary::{Arbitrary, Unstructured};
7073 let mut buf = [0u8; 1024];
7074 rng.fill_bytes(&mut buf);
7075 let mut unstructured = Unstructured::new(&buf);
7076 Self::arbitrary(&mut unstructured).unwrap_or_default()
7077 }
7078}
7079impl Default for CAMERA_FOV_STATUS_DATA {
7080 fn default() -> Self {
7081 Self::DEFAULT.clone()
7082 }
7083}
7084impl MessageData for CAMERA_FOV_STATUS_DATA {
7085 type Message = MavMessage;
7086 const ID: u32 = 271u32;
7087 const NAME: &'static str = "CAMERA_FOV_STATUS";
7088 const EXTRA_CRC: u8 = 22u8;
7089 const ENCODED_LEN: usize = 53usize;
7090 fn deser(
7091 _version: MavlinkVersion,
7092 __input: &[u8],
7093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7094 let avail_len = __input.len();
7095 let mut payload_buf = [0; Self::ENCODED_LEN];
7096 let mut buf = if avail_len < Self::ENCODED_LEN {
7097 payload_buf[0..avail_len].copy_from_slice(__input);
7098 Bytes::new(&payload_buf)
7099 } else {
7100 Bytes::new(__input)
7101 };
7102 let mut __struct = Self::default();
7103 __struct.time_boot_ms = buf.get_u32_le();
7104 __struct.lat_camera = buf.get_i32_le();
7105 __struct.lon_camera = buf.get_i32_le();
7106 __struct.alt_camera = buf.get_i32_le();
7107 __struct.lat_image = buf.get_i32_le();
7108 __struct.lon_image = buf.get_i32_le();
7109 __struct.alt_image = buf.get_i32_le();
7110 for v in &mut __struct.q {
7111 let val = buf.get_f32_le();
7112 *v = val;
7113 }
7114 __struct.hfov = buf.get_f32_le();
7115 __struct.vfov = buf.get_f32_le();
7116 __struct.camera_device_id = buf.get_u8();
7117 Ok(__struct)
7118 }
7119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7120 let mut __tmp = BytesMut::new(bytes);
7121 #[allow(clippy::absurd_extreme_comparisons)]
7122 #[allow(unused_comparisons)]
7123 if __tmp.remaining() < Self::ENCODED_LEN {
7124 panic!(
7125 "buffer is too small (need {} bytes, but got {})",
7126 Self::ENCODED_LEN,
7127 __tmp.remaining(),
7128 )
7129 }
7130 __tmp.put_u32_le(self.time_boot_ms);
7131 __tmp.put_i32_le(self.lat_camera);
7132 __tmp.put_i32_le(self.lon_camera);
7133 __tmp.put_i32_le(self.alt_camera);
7134 __tmp.put_i32_le(self.lat_image);
7135 __tmp.put_i32_le(self.lon_image);
7136 __tmp.put_i32_le(self.alt_image);
7137 for val in &self.q {
7138 __tmp.put_f32_le(*val);
7139 }
7140 __tmp.put_f32_le(self.hfov);
7141 __tmp.put_f32_le(self.vfov);
7142 if matches!(version, MavlinkVersion::V2) {
7143 __tmp.put_u8(self.camera_device_id);
7144 let len = __tmp.len();
7145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7146 } else {
7147 __tmp.len()
7148 }
7149 }
7150}
7151#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7152#[doc = ""]
7153#[doc = "ID: 263"]
7154#[derive(Debug, Clone, PartialEq)]
7155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7157#[cfg_attr(feature = "ts", derive(TS))]
7158#[cfg_attr(feature = "ts", ts(export))]
7159pub struct CAMERA_IMAGE_CAPTURED_DATA {
7160 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7161 pub time_utc: u64,
7162 #[doc = "Timestamp (time since system boot)."]
7163 pub time_boot_ms: u32,
7164 #[doc = "Latitude where image was taken"]
7165 pub lat: i32,
7166 #[doc = "Longitude where capture was taken"]
7167 pub lon: i32,
7168 #[doc = "Altitude (MSL) where image was taken"]
7169 pub alt: i32,
7170 #[doc = "Altitude above ground"]
7171 pub relative_alt: i32,
7172 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7173 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7174 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7175 pub q: [f32; 4],
7176 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7177 pub image_index: i32,
7178 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7179 pub camera_id: u8,
7180 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7181 pub capture_result: i8,
7182 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7183 #[cfg_attr(feature = "ts", ts(type = "string"))]
7184 pub file_url: CharArray<205>,
7185}
7186impl CAMERA_IMAGE_CAPTURED_DATA {
7187 pub const ENCODED_LEN: usize = 255usize;
7188 pub const DEFAULT: Self = Self {
7189 time_utc: 0_u64,
7190 time_boot_ms: 0_u32,
7191 lat: 0_i32,
7192 lon: 0_i32,
7193 alt: 0_i32,
7194 relative_alt: 0_i32,
7195 q: [0.0_f32; 4usize],
7196 image_index: 0_i32,
7197 camera_id: 0_u8,
7198 capture_result: 0_i8,
7199 file_url: CharArray::new([0_u8; 205usize]),
7200 };
7201 #[cfg(feature = "arbitrary")]
7202 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7203 use arbitrary::{Arbitrary, Unstructured};
7204 let mut buf = [0u8; 1024];
7205 rng.fill_bytes(&mut buf);
7206 let mut unstructured = Unstructured::new(&buf);
7207 Self::arbitrary(&mut unstructured).unwrap_or_default()
7208 }
7209}
7210impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7211 fn default() -> Self {
7212 Self::DEFAULT.clone()
7213 }
7214}
7215impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7216 type Message = MavMessage;
7217 const ID: u32 = 263u32;
7218 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7219 const EXTRA_CRC: u8 = 133u8;
7220 const ENCODED_LEN: usize = 255usize;
7221 fn deser(
7222 _version: MavlinkVersion,
7223 __input: &[u8],
7224 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7225 let avail_len = __input.len();
7226 let mut payload_buf = [0; Self::ENCODED_LEN];
7227 let mut buf = if avail_len < Self::ENCODED_LEN {
7228 payload_buf[0..avail_len].copy_from_slice(__input);
7229 Bytes::new(&payload_buf)
7230 } else {
7231 Bytes::new(__input)
7232 };
7233 let mut __struct = Self::default();
7234 __struct.time_utc = buf.get_u64_le();
7235 __struct.time_boot_ms = buf.get_u32_le();
7236 __struct.lat = buf.get_i32_le();
7237 __struct.lon = buf.get_i32_le();
7238 __struct.alt = buf.get_i32_le();
7239 __struct.relative_alt = buf.get_i32_le();
7240 for v in &mut __struct.q {
7241 let val = buf.get_f32_le();
7242 *v = val;
7243 }
7244 __struct.image_index = buf.get_i32_le();
7245 __struct.camera_id = buf.get_u8();
7246 __struct.capture_result = buf.get_i8();
7247 let mut tmp = [0_u8; 205usize];
7248 for v in &mut tmp {
7249 *v = buf.get_u8();
7250 }
7251 __struct.file_url = CharArray::new(tmp);
7252 Ok(__struct)
7253 }
7254 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7255 let mut __tmp = BytesMut::new(bytes);
7256 #[allow(clippy::absurd_extreme_comparisons)]
7257 #[allow(unused_comparisons)]
7258 if __tmp.remaining() < Self::ENCODED_LEN {
7259 panic!(
7260 "buffer is too small (need {} bytes, but got {})",
7261 Self::ENCODED_LEN,
7262 __tmp.remaining(),
7263 )
7264 }
7265 __tmp.put_u64_le(self.time_utc);
7266 __tmp.put_u32_le(self.time_boot_ms);
7267 __tmp.put_i32_le(self.lat);
7268 __tmp.put_i32_le(self.lon);
7269 __tmp.put_i32_le(self.alt);
7270 __tmp.put_i32_le(self.relative_alt);
7271 for val in &self.q {
7272 __tmp.put_f32_le(*val);
7273 }
7274 __tmp.put_i32_le(self.image_index);
7275 __tmp.put_u8(self.camera_id);
7276 __tmp.put_i8(self.capture_result);
7277 for val in &self.file_url {
7278 __tmp.put_u8(*val);
7279 }
7280 if matches!(version, MavlinkVersion::V2) {
7281 let len = __tmp.len();
7282 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7283 } else {
7284 __tmp.len()
7285 }
7286 }
7287}
7288#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7289#[doc = ""]
7290#[doc = "ID: 259"]
7291#[derive(Debug, Clone, PartialEq)]
7292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7294#[cfg_attr(feature = "ts", derive(TS))]
7295#[cfg_attr(feature = "ts", ts(export))]
7296pub struct CAMERA_INFORMATION_DATA {
7297 #[doc = "Timestamp (time since system boot)."]
7298 pub time_boot_ms: u32,
7299 #[doc = "0xff). Use 0 if not known."]
7300 pub firmware_version: u32,
7301 #[doc = "Focal length. Use NaN if not known."]
7302 pub focal_length: f32,
7303 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7304 pub sensor_size_h: f32,
7305 #[doc = "Image sensor size vertical. Use NaN if not known."]
7306 pub sensor_size_v: f32,
7307 #[doc = "Bitmap of camera capability flags."]
7308 pub flags: CameraCapFlags,
7309 #[doc = "Horizontal image resolution. Use 0 if not known."]
7310 pub resolution_h: u16,
7311 #[doc = "Vertical image resolution. Use 0 if not known."]
7312 pub resolution_v: u16,
7313 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7314 pub cam_definition_version: u16,
7315 #[doc = "Name of the camera vendor"]
7316 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7317 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7318 pub vendor_name: [u8; 32],
7319 #[doc = "Name of the camera model"]
7320 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7321 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7322 pub model_name: [u8; 32],
7323 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7324 pub lens_id: u8,
7325 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7326 #[cfg_attr(feature = "ts", ts(type = "string"))]
7327 pub cam_definition_uri: CharArray<140>,
7328 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7329 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7330 pub gimbal_device_id: u8,
7331 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7332 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7333 pub camera_device_id: u8,
7334}
7335impl CAMERA_INFORMATION_DATA {
7336 pub const ENCODED_LEN: usize = 237usize;
7337 pub const DEFAULT: Self = Self {
7338 time_boot_ms: 0_u32,
7339 firmware_version: 0_u32,
7340 focal_length: 0.0_f32,
7341 sensor_size_h: 0.0_f32,
7342 sensor_size_v: 0.0_f32,
7343 flags: CameraCapFlags::DEFAULT,
7344 resolution_h: 0_u16,
7345 resolution_v: 0_u16,
7346 cam_definition_version: 0_u16,
7347 vendor_name: [0_u8; 32usize],
7348 model_name: [0_u8; 32usize],
7349 lens_id: 0_u8,
7350 cam_definition_uri: CharArray::new([0_u8; 140usize]),
7351 gimbal_device_id: 0_u8,
7352 camera_device_id: 0_u8,
7353 };
7354 #[cfg(feature = "arbitrary")]
7355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7356 use arbitrary::{Arbitrary, Unstructured};
7357 let mut buf = [0u8; 1024];
7358 rng.fill_bytes(&mut buf);
7359 let mut unstructured = Unstructured::new(&buf);
7360 Self::arbitrary(&mut unstructured).unwrap_or_default()
7361 }
7362}
7363impl Default for CAMERA_INFORMATION_DATA {
7364 fn default() -> Self {
7365 Self::DEFAULT.clone()
7366 }
7367}
7368impl MessageData for CAMERA_INFORMATION_DATA {
7369 type Message = MavMessage;
7370 const ID: u32 = 259u32;
7371 const NAME: &'static str = "CAMERA_INFORMATION";
7372 const EXTRA_CRC: u8 = 92u8;
7373 const ENCODED_LEN: usize = 237usize;
7374 fn deser(
7375 _version: MavlinkVersion,
7376 __input: &[u8],
7377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7378 let avail_len = __input.len();
7379 let mut payload_buf = [0; Self::ENCODED_LEN];
7380 let mut buf = if avail_len < Self::ENCODED_LEN {
7381 payload_buf[0..avail_len].copy_from_slice(__input);
7382 Bytes::new(&payload_buf)
7383 } else {
7384 Bytes::new(__input)
7385 };
7386 let mut __struct = Self::default();
7387 __struct.time_boot_ms = buf.get_u32_le();
7388 __struct.firmware_version = buf.get_u32_le();
7389 __struct.focal_length = buf.get_f32_le();
7390 __struct.sensor_size_h = buf.get_f32_le();
7391 __struct.sensor_size_v = buf.get_f32_le();
7392 let tmp = buf.get_u32_le();
7393 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7394 ::mavlink_core::error::ParserError::InvalidFlag {
7395 flag_type: "CameraCapFlags",
7396 value: tmp as u32,
7397 },
7398 )?;
7399 __struct.resolution_h = buf.get_u16_le();
7400 __struct.resolution_v = buf.get_u16_le();
7401 __struct.cam_definition_version = buf.get_u16_le();
7402 for v in &mut __struct.vendor_name {
7403 let val = buf.get_u8();
7404 *v = val;
7405 }
7406 for v in &mut __struct.model_name {
7407 let val = buf.get_u8();
7408 *v = val;
7409 }
7410 __struct.lens_id = buf.get_u8();
7411 let mut tmp = [0_u8; 140usize];
7412 for v in &mut tmp {
7413 *v = buf.get_u8();
7414 }
7415 __struct.cam_definition_uri = CharArray::new(tmp);
7416 __struct.gimbal_device_id = buf.get_u8();
7417 __struct.camera_device_id = buf.get_u8();
7418 Ok(__struct)
7419 }
7420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7421 let mut __tmp = BytesMut::new(bytes);
7422 #[allow(clippy::absurd_extreme_comparisons)]
7423 #[allow(unused_comparisons)]
7424 if __tmp.remaining() < Self::ENCODED_LEN {
7425 panic!(
7426 "buffer is too small (need {} bytes, but got {})",
7427 Self::ENCODED_LEN,
7428 __tmp.remaining(),
7429 )
7430 }
7431 __tmp.put_u32_le(self.time_boot_ms);
7432 __tmp.put_u32_le(self.firmware_version);
7433 __tmp.put_f32_le(self.focal_length);
7434 __tmp.put_f32_le(self.sensor_size_h);
7435 __tmp.put_f32_le(self.sensor_size_v);
7436 __tmp.put_u32_le(self.flags.bits());
7437 __tmp.put_u16_le(self.resolution_h);
7438 __tmp.put_u16_le(self.resolution_v);
7439 __tmp.put_u16_le(self.cam_definition_version);
7440 for val in &self.vendor_name {
7441 __tmp.put_u8(*val);
7442 }
7443 for val in &self.model_name {
7444 __tmp.put_u8(*val);
7445 }
7446 __tmp.put_u8(self.lens_id);
7447 for val in &self.cam_definition_uri {
7448 __tmp.put_u8(*val);
7449 }
7450 if matches!(version, MavlinkVersion::V2) {
7451 __tmp.put_u8(self.gimbal_device_id);
7452 __tmp.put_u8(self.camera_device_id);
7453 let len = __tmp.len();
7454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7455 } else {
7456 __tmp.len()
7457 }
7458 }
7459}
7460#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7461#[doc = ""]
7462#[doc = "ID: 260"]
7463#[derive(Debug, Clone, PartialEq)]
7464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7465#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7466#[cfg_attr(feature = "ts", derive(TS))]
7467#[cfg_attr(feature = "ts", ts(export))]
7468pub struct CAMERA_SETTINGS_DATA {
7469 #[doc = "Timestamp (time since system boot)."]
7470 pub time_boot_ms: u32,
7471 #[doc = "Camera mode"]
7472 pub mode_id: CameraMode,
7473 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7474 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7475 pub zoomLevel: f32,
7476 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7477 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7478 pub focusLevel: f32,
7479 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7480 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7481 pub camera_device_id: u8,
7482}
7483impl CAMERA_SETTINGS_DATA {
7484 pub const ENCODED_LEN: usize = 14usize;
7485 pub const DEFAULT: Self = Self {
7486 time_boot_ms: 0_u32,
7487 mode_id: CameraMode::DEFAULT,
7488 zoomLevel: 0.0_f32,
7489 focusLevel: 0.0_f32,
7490 camera_device_id: 0_u8,
7491 };
7492 #[cfg(feature = "arbitrary")]
7493 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7494 use arbitrary::{Arbitrary, Unstructured};
7495 let mut buf = [0u8; 1024];
7496 rng.fill_bytes(&mut buf);
7497 let mut unstructured = Unstructured::new(&buf);
7498 Self::arbitrary(&mut unstructured).unwrap_or_default()
7499 }
7500}
7501impl Default for CAMERA_SETTINGS_DATA {
7502 fn default() -> Self {
7503 Self::DEFAULT.clone()
7504 }
7505}
7506impl MessageData for CAMERA_SETTINGS_DATA {
7507 type Message = MavMessage;
7508 const ID: u32 = 260u32;
7509 const NAME: &'static str = "CAMERA_SETTINGS";
7510 const EXTRA_CRC: u8 = 146u8;
7511 const ENCODED_LEN: usize = 14usize;
7512 fn deser(
7513 _version: MavlinkVersion,
7514 __input: &[u8],
7515 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7516 let avail_len = __input.len();
7517 let mut payload_buf = [0; Self::ENCODED_LEN];
7518 let mut buf = if avail_len < Self::ENCODED_LEN {
7519 payload_buf[0..avail_len].copy_from_slice(__input);
7520 Bytes::new(&payload_buf)
7521 } else {
7522 Bytes::new(__input)
7523 };
7524 let mut __struct = Self::default();
7525 __struct.time_boot_ms = buf.get_u32_le();
7526 let tmp = buf.get_u8();
7527 __struct.mode_id =
7528 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7529 enum_type: "CameraMode",
7530 value: tmp as u32,
7531 })?;
7532 __struct.zoomLevel = buf.get_f32_le();
7533 __struct.focusLevel = buf.get_f32_le();
7534 __struct.camera_device_id = buf.get_u8();
7535 Ok(__struct)
7536 }
7537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7538 let mut __tmp = BytesMut::new(bytes);
7539 #[allow(clippy::absurd_extreme_comparisons)]
7540 #[allow(unused_comparisons)]
7541 if __tmp.remaining() < Self::ENCODED_LEN {
7542 panic!(
7543 "buffer is too small (need {} bytes, but got {})",
7544 Self::ENCODED_LEN,
7545 __tmp.remaining(),
7546 )
7547 }
7548 __tmp.put_u32_le(self.time_boot_ms);
7549 __tmp.put_u8(self.mode_id as u8);
7550 if matches!(version, MavlinkVersion::V2) {
7551 __tmp.put_f32_le(self.zoomLevel);
7552 __tmp.put_f32_le(self.focusLevel);
7553 __tmp.put_u8(self.camera_device_id);
7554 let len = __tmp.len();
7555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7556 } else {
7557 __tmp.len()
7558 }
7559 }
7560}
7561#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7562#[doc = ""]
7563#[doc = "ID: 277"]
7564#[derive(Debug, Clone, PartialEq)]
7565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7567#[cfg_attr(feature = "ts", derive(TS))]
7568#[cfg_attr(feature = "ts", ts(export))]
7569pub struct CAMERA_THERMAL_RANGE_DATA {
7570 #[doc = "Timestamp (time since system boot)."]
7571 pub time_boot_ms: u32,
7572 #[doc = "Temperature max."]
7573 pub max: f32,
7574 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7575 pub max_point_x: f32,
7576 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7577 pub max_point_y: f32,
7578 #[doc = "Temperature min."]
7579 pub min: f32,
7580 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7581 pub min_point_x: f32,
7582 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7583 pub min_point_y: f32,
7584 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7585 pub stream_id: u8,
7586 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7587 pub camera_device_id: u8,
7588}
7589impl CAMERA_THERMAL_RANGE_DATA {
7590 pub const ENCODED_LEN: usize = 30usize;
7591 pub const DEFAULT: Self = Self {
7592 time_boot_ms: 0_u32,
7593 max: 0.0_f32,
7594 max_point_x: 0.0_f32,
7595 max_point_y: 0.0_f32,
7596 min: 0.0_f32,
7597 min_point_x: 0.0_f32,
7598 min_point_y: 0.0_f32,
7599 stream_id: 0_u8,
7600 camera_device_id: 0_u8,
7601 };
7602 #[cfg(feature = "arbitrary")]
7603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7604 use arbitrary::{Arbitrary, Unstructured};
7605 let mut buf = [0u8; 1024];
7606 rng.fill_bytes(&mut buf);
7607 let mut unstructured = Unstructured::new(&buf);
7608 Self::arbitrary(&mut unstructured).unwrap_or_default()
7609 }
7610}
7611impl Default for CAMERA_THERMAL_RANGE_DATA {
7612 fn default() -> Self {
7613 Self::DEFAULT.clone()
7614 }
7615}
7616impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7617 type Message = MavMessage;
7618 const ID: u32 = 277u32;
7619 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7620 const EXTRA_CRC: u8 = 62u8;
7621 const ENCODED_LEN: usize = 30usize;
7622 fn deser(
7623 _version: MavlinkVersion,
7624 __input: &[u8],
7625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7626 let avail_len = __input.len();
7627 let mut payload_buf = [0; Self::ENCODED_LEN];
7628 let mut buf = if avail_len < Self::ENCODED_LEN {
7629 payload_buf[0..avail_len].copy_from_slice(__input);
7630 Bytes::new(&payload_buf)
7631 } else {
7632 Bytes::new(__input)
7633 };
7634 let mut __struct = Self::default();
7635 __struct.time_boot_ms = buf.get_u32_le();
7636 __struct.max = buf.get_f32_le();
7637 __struct.max_point_x = buf.get_f32_le();
7638 __struct.max_point_y = buf.get_f32_le();
7639 __struct.min = buf.get_f32_le();
7640 __struct.min_point_x = buf.get_f32_le();
7641 __struct.min_point_y = buf.get_f32_le();
7642 __struct.stream_id = buf.get_u8();
7643 __struct.camera_device_id = buf.get_u8();
7644 Ok(__struct)
7645 }
7646 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7647 let mut __tmp = BytesMut::new(bytes);
7648 #[allow(clippy::absurd_extreme_comparisons)]
7649 #[allow(unused_comparisons)]
7650 if __tmp.remaining() < Self::ENCODED_LEN {
7651 panic!(
7652 "buffer is too small (need {} bytes, but got {})",
7653 Self::ENCODED_LEN,
7654 __tmp.remaining(),
7655 )
7656 }
7657 __tmp.put_u32_le(self.time_boot_ms);
7658 __tmp.put_f32_le(self.max);
7659 __tmp.put_f32_le(self.max_point_x);
7660 __tmp.put_f32_le(self.max_point_y);
7661 __tmp.put_f32_le(self.min);
7662 __tmp.put_f32_le(self.min_point_x);
7663 __tmp.put_f32_le(self.min_point_y);
7664 __tmp.put_u8(self.stream_id);
7665 __tmp.put_u8(self.camera_device_id);
7666 if matches!(version, MavlinkVersion::V2) {
7667 let len = __tmp.len();
7668 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7669 } else {
7670 __tmp.len()
7671 }
7672 }
7673}
7674#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7675#[doc = ""]
7676#[doc = "ID: 276"]
7677#[derive(Debug, Clone, PartialEq)]
7678#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7680#[cfg_attr(feature = "ts", derive(TS))]
7681#[cfg_attr(feature = "ts", ts(export))]
7682pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7683 #[doc = "Latitude of tracked object"]
7684 pub lat: i32,
7685 #[doc = "Longitude of tracked object"]
7686 pub lon: i32,
7687 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7688 pub alt: f32,
7689 #[doc = "Horizontal accuracy. NAN if unknown"]
7690 pub h_acc: f32,
7691 #[doc = "Vertical accuracy. NAN if unknown"]
7692 pub v_acc: f32,
7693 #[doc = "North velocity of tracked object. NAN if unknown"]
7694 pub vel_n: f32,
7695 #[doc = "East velocity of tracked object. NAN if unknown"]
7696 pub vel_e: f32,
7697 #[doc = "Down velocity of tracked object. NAN if unknown"]
7698 pub vel_d: f32,
7699 #[doc = "Velocity accuracy. NAN if unknown"]
7700 pub vel_acc: f32,
7701 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7702 pub dist: f32,
7703 #[doc = "Heading in radians, in NED. NAN if unknown"]
7704 pub hdg: f32,
7705 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7706 pub hdg_acc: f32,
7707 #[doc = "Current tracking status"]
7708 pub tracking_status: CameraTrackingStatusFlags,
7709 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7710 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7711 pub camera_device_id: u8,
7712}
7713impl CAMERA_TRACKING_GEO_STATUS_DATA {
7714 pub const ENCODED_LEN: usize = 50usize;
7715 pub const DEFAULT: Self = Self {
7716 lat: 0_i32,
7717 lon: 0_i32,
7718 alt: 0.0_f32,
7719 h_acc: 0.0_f32,
7720 v_acc: 0.0_f32,
7721 vel_n: 0.0_f32,
7722 vel_e: 0.0_f32,
7723 vel_d: 0.0_f32,
7724 vel_acc: 0.0_f32,
7725 dist: 0.0_f32,
7726 hdg: 0.0_f32,
7727 hdg_acc: 0.0_f32,
7728 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7729 camera_device_id: 0_u8,
7730 };
7731 #[cfg(feature = "arbitrary")]
7732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7733 use arbitrary::{Arbitrary, Unstructured};
7734 let mut buf = [0u8; 1024];
7735 rng.fill_bytes(&mut buf);
7736 let mut unstructured = Unstructured::new(&buf);
7737 Self::arbitrary(&mut unstructured).unwrap_or_default()
7738 }
7739}
7740impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7741 fn default() -> Self {
7742 Self::DEFAULT.clone()
7743 }
7744}
7745impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7746 type Message = MavMessage;
7747 const ID: u32 = 276u32;
7748 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7749 const EXTRA_CRC: u8 = 18u8;
7750 const ENCODED_LEN: usize = 50usize;
7751 fn deser(
7752 _version: MavlinkVersion,
7753 __input: &[u8],
7754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7755 let avail_len = __input.len();
7756 let mut payload_buf = [0; Self::ENCODED_LEN];
7757 let mut buf = if avail_len < Self::ENCODED_LEN {
7758 payload_buf[0..avail_len].copy_from_slice(__input);
7759 Bytes::new(&payload_buf)
7760 } else {
7761 Bytes::new(__input)
7762 };
7763 let mut __struct = Self::default();
7764 __struct.lat = buf.get_i32_le();
7765 __struct.lon = buf.get_i32_le();
7766 __struct.alt = buf.get_f32_le();
7767 __struct.h_acc = buf.get_f32_le();
7768 __struct.v_acc = buf.get_f32_le();
7769 __struct.vel_n = buf.get_f32_le();
7770 __struct.vel_e = buf.get_f32_le();
7771 __struct.vel_d = buf.get_f32_le();
7772 __struct.vel_acc = buf.get_f32_le();
7773 __struct.dist = buf.get_f32_le();
7774 __struct.hdg = buf.get_f32_le();
7775 __struct.hdg_acc = buf.get_f32_le();
7776 let tmp = buf.get_u8();
7777 __struct.tracking_status =
7778 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7779 enum_type: "CameraTrackingStatusFlags",
7780 value: tmp as u32,
7781 })?;
7782 __struct.camera_device_id = buf.get_u8();
7783 Ok(__struct)
7784 }
7785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7786 let mut __tmp = BytesMut::new(bytes);
7787 #[allow(clippy::absurd_extreme_comparisons)]
7788 #[allow(unused_comparisons)]
7789 if __tmp.remaining() < Self::ENCODED_LEN {
7790 panic!(
7791 "buffer is too small (need {} bytes, but got {})",
7792 Self::ENCODED_LEN,
7793 __tmp.remaining(),
7794 )
7795 }
7796 __tmp.put_i32_le(self.lat);
7797 __tmp.put_i32_le(self.lon);
7798 __tmp.put_f32_le(self.alt);
7799 __tmp.put_f32_le(self.h_acc);
7800 __tmp.put_f32_le(self.v_acc);
7801 __tmp.put_f32_le(self.vel_n);
7802 __tmp.put_f32_le(self.vel_e);
7803 __tmp.put_f32_le(self.vel_d);
7804 __tmp.put_f32_le(self.vel_acc);
7805 __tmp.put_f32_le(self.dist);
7806 __tmp.put_f32_le(self.hdg);
7807 __tmp.put_f32_le(self.hdg_acc);
7808 __tmp.put_u8(self.tracking_status as u8);
7809 if matches!(version, MavlinkVersion::V2) {
7810 __tmp.put_u8(self.camera_device_id);
7811 let len = __tmp.len();
7812 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7813 } else {
7814 __tmp.len()
7815 }
7816 }
7817}
7818#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7819#[doc = ""]
7820#[doc = "ID: 275"]
7821#[derive(Debug, Clone, PartialEq)]
7822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7824#[cfg_attr(feature = "ts", derive(TS))]
7825#[cfg_attr(feature = "ts", ts(export))]
7826pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7827 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7828 pub point_x: f32,
7829 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7830 pub point_y: f32,
7831 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7832 pub radius: f32,
7833 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7834 pub rec_top_x: f32,
7835 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7836 pub rec_top_y: f32,
7837 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7838 pub rec_bottom_x: f32,
7839 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7840 pub rec_bottom_y: f32,
7841 #[doc = "Current tracking status"]
7842 pub tracking_status: CameraTrackingStatusFlags,
7843 #[doc = "Current tracking mode"]
7844 pub tracking_mode: CameraTrackingMode,
7845 #[doc = "Defines location of target data"]
7846 pub target_data: CameraTrackingTargetData,
7847 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7848 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7849 pub camera_device_id: u8,
7850}
7851impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7852 pub const ENCODED_LEN: usize = 32usize;
7853 pub const DEFAULT: Self = Self {
7854 point_x: 0.0_f32,
7855 point_y: 0.0_f32,
7856 radius: 0.0_f32,
7857 rec_top_x: 0.0_f32,
7858 rec_top_y: 0.0_f32,
7859 rec_bottom_x: 0.0_f32,
7860 rec_bottom_y: 0.0_f32,
7861 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7862 tracking_mode: CameraTrackingMode::DEFAULT,
7863 target_data: CameraTrackingTargetData::DEFAULT,
7864 camera_device_id: 0_u8,
7865 };
7866 #[cfg(feature = "arbitrary")]
7867 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7868 use arbitrary::{Arbitrary, Unstructured};
7869 let mut buf = [0u8; 1024];
7870 rng.fill_bytes(&mut buf);
7871 let mut unstructured = Unstructured::new(&buf);
7872 Self::arbitrary(&mut unstructured).unwrap_or_default()
7873 }
7874}
7875impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7876 fn default() -> Self {
7877 Self::DEFAULT.clone()
7878 }
7879}
7880impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7881 type Message = MavMessage;
7882 const ID: u32 = 275u32;
7883 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7884 const EXTRA_CRC: u8 = 126u8;
7885 const ENCODED_LEN: usize = 32usize;
7886 fn deser(
7887 _version: MavlinkVersion,
7888 __input: &[u8],
7889 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7890 let avail_len = __input.len();
7891 let mut payload_buf = [0; Self::ENCODED_LEN];
7892 let mut buf = if avail_len < Self::ENCODED_LEN {
7893 payload_buf[0..avail_len].copy_from_slice(__input);
7894 Bytes::new(&payload_buf)
7895 } else {
7896 Bytes::new(__input)
7897 };
7898 let mut __struct = Self::default();
7899 __struct.point_x = buf.get_f32_le();
7900 __struct.point_y = buf.get_f32_le();
7901 __struct.radius = buf.get_f32_le();
7902 __struct.rec_top_x = buf.get_f32_le();
7903 __struct.rec_top_y = buf.get_f32_le();
7904 __struct.rec_bottom_x = buf.get_f32_le();
7905 __struct.rec_bottom_y = buf.get_f32_le();
7906 let tmp = buf.get_u8();
7907 __struct.tracking_status =
7908 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7909 enum_type: "CameraTrackingStatusFlags",
7910 value: tmp as u32,
7911 })?;
7912 let tmp = buf.get_u8();
7913 __struct.tracking_mode =
7914 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7915 enum_type: "CameraTrackingMode",
7916 value: tmp as u32,
7917 })?;
7918 let tmp = buf.get_u8();
7919 __struct.target_data =
7920 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7921 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7922 flag_type: "CameraTrackingTargetData",
7923 value: tmp as u32,
7924 })?;
7925 __struct.camera_device_id = buf.get_u8();
7926 Ok(__struct)
7927 }
7928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7929 let mut __tmp = BytesMut::new(bytes);
7930 #[allow(clippy::absurd_extreme_comparisons)]
7931 #[allow(unused_comparisons)]
7932 if __tmp.remaining() < Self::ENCODED_LEN {
7933 panic!(
7934 "buffer is too small (need {} bytes, but got {})",
7935 Self::ENCODED_LEN,
7936 __tmp.remaining(),
7937 )
7938 }
7939 __tmp.put_f32_le(self.point_x);
7940 __tmp.put_f32_le(self.point_y);
7941 __tmp.put_f32_le(self.radius);
7942 __tmp.put_f32_le(self.rec_top_x);
7943 __tmp.put_f32_le(self.rec_top_y);
7944 __tmp.put_f32_le(self.rec_bottom_x);
7945 __tmp.put_f32_le(self.rec_bottom_y);
7946 __tmp.put_u8(self.tracking_status as u8);
7947 __tmp.put_u8(self.tracking_mode as u8);
7948 __tmp.put_u8(self.target_data.bits());
7949 if matches!(version, MavlinkVersion::V2) {
7950 __tmp.put_u8(self.camera_device_id);
7951 let len = __tmp.len();
7952 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7953 } else {
7954 __tmp.len()
7955 }
7956 }
7957}
7958#[doc = "Camera-IMU triggering and synchronisation message."]
7959#[doc = ""]
7960#[doc = "ID: 112"]
7961#[derive(Debug, Clone, PartialEq)]
7962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7964#[cfg_attr(feature = "ts", derive(TS))]
7965#[cfg_attr(feature = "ts", ts(export))]
7966pub struct CAMERA_TRIGGER_DATA {
7967 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7968 pub time_usec: u64,
7969 #[doc = "Image frame sequence"]
7970 pub seq: u32,
7971}
7972impl CAMERA_TRIGGER_DATA {
7973 pub const ENCODED_LEN: usize = 12usize;
7974 pub const DEFAULT: Self = Self {
7975 time_usec: 0_u64,
7976 seq: 0_u32,
7977 };
7978 #[cfg(feature = "arbitrary")]
7979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7980 use arbitrary::{Arbitrary, Unstructured};
7981 let mut buf = [0u8; 1024];
7982 rng.fill_bytes(&mut buf);
7983 let mut unstructured = Unstructured::new(&buf);
7984 Self::arbitrary(&mut unstructured).unwrap_or_default()
7985 }
7986}
7987impl Default for CAMERA_TRIGGER_DATA {
7988 fn default() -> Self {
7989 Self::DEFAULT.clone()
7990 }
7991}
7992impl MessageData for CAMERA_TRIGGER_DATA {
7993 type Message = MavMessage;
7994 const ID: u32 = 112u32;
7995 const NAME: &'static str = "CAMERA_TRIGGER";
7996 const EXTRA_CRC: u8 = 174u8;
7997 const ENCODED_LEN: usize = 12usize;
7998 fn deser(
7999 _version: MavlinkVersion,
8000 __input: &[u8],
8001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8002 let avail_len = __input.len();
8003 let mut payload_buf = [0; Self::ENCODED_LEN];
8004 let mut buf = if avail_len < Self::ENCODED_LEN {
8005 payload_buf[0..avail_len].copy_from_slice(__input);
8006 Bytes::new(&payload_buf)
8007 } else {
8008 Bytes::new(__input)
8009 };
8010 let mut __struct = Self::default();
8011 __struct.time_usec = buf.get_u64_le();
8012 __struct.seq = buf.get_u32_le();
8013 Ok(__struct)
8014 }
8015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8016 let mut __tmp = BytesMut::new(bytes);
8017 #[allow(clippy::absurd_extreme_comparisons)]
8018 #[allow(unused_comparisons)]
8019 if __tmp.remaining() < Self::ENCODED_LEN {
8020 panic!(
8021 "buffer is too small (need {} bytes, but got {})",
8022 Self::ENCODED_LEN,
8023 __tmp.remaining(),
8024 )
8025 }
8026 __tmp.put_u64_le(self.time_usec);
8027 __tmp.put_u32_le(self.seq);
8028 if matches!(version, MavlinkVersion::V2) {
8029 let len = __tmp.len();
8030 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8031 } else {
8032 __tmp.len()
8033 }
8034 }
8035}
8036#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8037#[doc = ""]
8038#[doc = "ID: 387"]
8039#[derive(Debug, Clone, PartialEq)]
8040#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8042#[cfg_attr(feature = "ts", derive(TS))]
8043#[cfg_attr(feature = "ts", ts(export))]
8044pub struct CANFD_FRAME_DATA {
8045 #[doc = "Frame ID"]
8046 pub id: u32,
8047 #[doc = "System ID."]
8048 pub target_system: u8,
8049 #[doc = "Component ID."]
8050 pub target_component: u8,
8051 #[doc = "bus number"]
8052 pub bus: u8,
8053 #[doc = "Frame length"]
8054 pub len: u8,
8055 #[doc = "Frame data"]
8056 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8057 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8058 pub data: [u8; 64],
8059}
8060impl CANFD_FRAME_DATA {
8061 pub const ENCODED_LEN: usize = 72usize;
8062 pub const DEFAULT: Self = Self {
8063 id: 0_u32,
8064 target_system: 0_u8,
8065 target_component: 0_u8,
8066 bus: 0_u8,
8067 len: 0_u8,
8068 data: [0_u8; 64usize],
8069 };
8070 #[cfg(feature = "arbitrary")]
8071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8072 use arbitrary::{Arbitrary, Unstructured};
8073 let mut buf = [0u8; 1024];
8074 rng.fill_bytes(&mut buf);
8075 let mut unstructured = Unstructured::new(&buf);
8076 Self::arbitrary(&mut unstructured).unwrap_or_default()
8077 }
8078}
8079impl Default for CANFD_FRAME_DATA {
8080 fn default() -> Self {
8081 Self::DEFAULT.clone()
8082 }
8083}
8084impl MessageData for CANFD_FRAME_DATA {
8085 type Message = MavMessage;
8086 const ID: u32 = 387u32;
8087 const NAME: &'static str = "CANFD_FRAME";
8088 const EXTRA_CRC: u8 = 4u8;
8089 const ENCODED_LEN: usize = 72usize;
8090 fn deser(
8091 _version: MavlinkVersion,
8092 __input: &[u8],
8093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8094 let avail_len = __input.len();
8095 let mut payload_buf = [0; Self::ENCODED_LEN];
8096 let mut buf = if avail_len < Self::ENCODED_LEN {
8097 payload_buf[0..avail_len].copy_from_slice(__input);
8098 Bytes::new(&payload_buf)
8099 } else {
8100 Bytes::new(__input)
8101 };
8102 let mut __struct = Self::default();
8103 __struct.id = buf.get_u32_le();
8104 __struct.target_system = buf.get_u8();
8105 __struct.target_component = buf.get_u8();
8106 __struct.bus = buf.get_u8();
8107 __struct.len = buf.get_u8();
8108 for v in &mut __struct.data {
8109 let val = buf.get_u8();
8110 *v = val;
8111 }
8112 Ok(__struct)
8113 }
8114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8115 let mut __tmp = BytesMut::new(bytes);
8116 #[allow(clippy::absurd_extreme_comparisons)]
8117 #[allow(unused_comparisons)]
8118 if __tmp.remaining() < Self::ENCODED_LEN {
8119 panic!(
8120 "buffer is too small (need {} bytes, but got {})",
8121 Self::ENCODED_LEN,
8122 __tmp.remaining(),
8123 )
8124 }
8125 __tmp.put_u32_le(self.id);
8126 __tmp.put_u8(self.target_system);
8127 __tmp.put_u8(self.target_component);
8128 __tmp.put_u8(self.bus);
8129 __tmp.put_u8(self.len);
8130 for val in &self.data {
8131 __tmp.put_u8(*val);
8132 }
8133 if matches!(version, MavlinkVersion::V2) {
8134 let len = __tmp.len();
8135 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8136 } else {
8137 __tmp.len()
8138 }
8139 }
8140}
8141#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8142#[doc = ""]
8143#[doc = "ID: 388"]
8144#[derive(Debug, Clone, PartialEq)]
8145#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8146#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8147#[cfg_attr(feature = "ts", derive(TS))]
8148#[cfg_attr(feature = "ts", ts(export))]
8149pub struct CAN_FILTER_MODIFY_DATA {
8150 #[doc = "filter IDs, length num_ids"]
8151 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8152 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8153 pub ids: [u16; 16],
8154 #[doc = "System ID."]
8155 pub target_system: u8,
8156 #[doc = "Component ID."]
8157 pub target_component: u8,
8158 #[doc = "bus number"]
8159 pub bus: u8,
8160 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8161 pub operation: CanFilterOp,
8162 #[doc = "number of IDs in filter list"]
8163 pub num_ids: u8,
8164}
8165impl CAN_FILTER_MODIFY_DATA {
8166 pub const ENCODED_LEN: usize = 37usize;
8167 pub const DEFAULT: Self = Self {
8168 ids: [0_u16; 16usize],
8169 target_system: 0_u8,
8170 target_component: 0_u8,
8171 bus: 0_u8,
8172 operation: CanFilterOp::DEFAULT,
8173 num_ids: 0_u8,
8174 };
8175 #[cfg(feature = "arbitrary")]
8176 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8177 use arbitrary::{Arbitrary, Unstructured};
8178 let mut buf = [0u8; 1024];
8179 rng.fill_bytes(&mut buf);
8180 let mut unstructured = Unstructured::new(&buf);
8181 Self::arbitrary(&mut unstructured).unwrap_or_default()
8182 }
8183}
8184impl Default for CAN_FILTER_MODIFY_DATA {
8185 fn default() -> Self {
8186 Self::DEFAULT.clone()
8187 }
8188}
8189impl MessageData for CAN_FILTER_MODIFY_DATA {
8190 type Message = MavMessage;
8191 const ID: u32 = 388u32;
8192 const NAME: &'static str = "CAN_FILTER_MODIFY";
8193 const EXTRA_CRC: u8 = 8u8;
8194 const ENCODED_LEN: usize = 37usize;
8195 fn deser(
8196 _version: MavlinkVersion,
8197 __input: &[u8],
8198 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8199 let avail_len = __input.len();
8200 let mut payload_buf = [0; Self::ENCODED_LEN];
8201 let mut buf = if avail_len < Self::ENCODED_LEN {
8202 payload_buf[0..avail_len].copy_from_slice(__input);
8203 Bytes::new(&payload_buf)
8204 } else {
8205 Bytes::new(__input)
8206 };
8207 let mut __struct = Self::default();
8208 for v in &mut __struct.ids {
8209 let val = buf.get_u16_le();
8210 *v = val;
8211 }
8212 __struct.target_system = buf.get_u8();
8213 __struct.target_component = buf.get_u8();
8214 __struct.bus = buf.get_u8();
8215 let tmp = buf.get_u8();
8216 __struct.operation =
8217 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8218 enum_type: "CanFilterOp",
8219 value: tmp as u32,
8220 })?;
8221 __struct.num_ids = buf.get_u8();
8222 Ok(__struct)
8223 }
8224 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8225 let mut __tmp = BytesMut::new(bytes);
8226 #[allow(clippy::absurd_extreme_comparisons)]
8227 #[allow(unused_comparisons)]
8228 if __tmp.remaining() < Self::ENCODED_LEN {
8229 panic!(
8230 "buffer is too small (need {} bytes, but got {})",
8231 Self::ENCODED_LEN,
8232 __tmp.remaining(),
8233 )
8234 }
8235 for val in &self.ids {
8236 __tmp.put_u16_le(*val);
8237 }
8238 __tmp.put_u8(self.target_system);
8239 __tmp.put_u8(self.target_component);
8240 __tmp.put_u8(self.bus);
8241 __tmp.put_u8(self.operation as u8);
8242 __tmp.put_u8(self.num_ids);
8243 if matches!(version, MavlinkVersion::V2) {
8244 let len = __tmp.len();
8245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8246 } else {
8247 __tmp.len()
8248 }
8249 }
8250}
8251#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8252#[doc = ""]
8253#[doc = "ID: 386"]
8254#[derive(Debug, Clone, PartialEq)]
8255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8257#[cfg_attr(feature = "ts", derive(TS))]
8258#[cfg_attr(feature = "ts", ts(export))]
8259pub struct CAN_FRAME_DATA {
8260 #[doc = "Frame ID"]
8261 pub id: u32,
8262 #[doc = "System ID."]
8263 pub target_system: u8,
8264 #[doc = "Component ID."]
8265 pub target_component: u8,
8266 #[doc = "Bus number"]
8267 pub bus: u8,
8268 #[doc = "Frame length"]
8269 pub len: u8,
8270 #[doc = "Frame data"]
8271 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8272 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8273 pub data: [u8; 8],
8274}
8275impl CAN_FRAME_DATA {
8276 pub const ENCODED_LEN: usize = 16usize;
8277 pub const DEFAULT: Self = Self {
8278 id: 0_u32,
8279 target_system: 0_u8,
8280 target_component: 0_u8,
8281 bus: 0_u8,
8282 len: 0_u8,
8283 data: [0_u8; 8usize],
8284 };
8285 #[cfg(feature = "arbitrary")]
8286 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8287 use arbitrary::{Arbitrary, Unstructured};
8288 let mut buf = [0u8; 1024];
8289 rng.fill_bytes(&mut buf);
8290 let mut unstructured = Unstructured::new(&buf);
8291 Self::arbitrary(&mut unstructured).unwrap_or_default()
8292 }
8293}
8294impl Default for CAN_FRAME_DATA {
8295 fn default() -> Self {
8296 Self::DEFAULT.clone()
8297 }
8298}
8299impl MessageData for CAN_FRAME_DATA {
8300 type Message = MavMessage;
8301 const ID: u32 = 386u32;
8302 const NAME: &'static str = "CAN_FRAME";
8303 const EXTRA_CRC: u8 = 132u8;
8304 const ENCODED_LEN: usize = 16usize;
8305 fn deser(
8306 _version: MavlinkVersion,
8307 __input: &[u8],
8308 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8309 let avail_len = __input.len();
8310 let mut payload_buf = [0; Self::ENCODED_LEN];
8311 let mut buf = if avail_len < Self::ENCODED_LEN {
8312 payload_buf[0..avail_len].copy_from_slice(__input);
8313 Bytes::new(&payload_buf)
8314 } else {
8315 Bytes::new(__input)
8316 };
8317 let mut __struct = Self::default();
8318 __struct.id = buf.get_u32_le();
8319 __struct.target_system = buf.get_u8();
8320 __struct.target_component = buf.get_u8();
8321 __struct.bus = buf.get_u8();
8322 __struct.len = buf.get_u8();
8323 for v in &mut __struct.data {
8324 let val = buf.get_u8();
8325 *v = val;
8326 }
8327 Ok(__struct)
8328 }
8329 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8330 let mut __tmp = BytesMut::new(bytes);
8331 #[allow(clippy::absurd_extreme_comparisons)]
8332 #[allow(unused_comparisons)]
8333 if __tmp.remaining() < Self::ENCODED_LEN {
8334 panic!(
8335 "buffer is too small (need {} bytes, but got {})",
8336 Self::ENCODED_LEN,
8337 __tmp.remaining(),
8338 )
8339 }
8340 __tmp.put_u32_le(self.id);
8341 __tmp.put_u8(self.target_system);
8342 __tmp.put_u8(self.target_component);
8343 __tmp.put_u8(self.bus);
8344 __tmp.put_u8(self.len);
8345 for val in &self.data {
8346 __tmp.put_u8(*val);
8347 }
8348 if matches!(version, MavlinkVersion::V2) {
8349 let len = __tmp.len();
8350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8351 } else {
8352 __tmp.len()
8353 }
8354 }
8355}
8356#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8357#[doc = ""]
8358#[doc = "ID: 336"]
8359#[derive(Debug, Clone, PartialEq)]
8360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8362#[cfg_attr(feature = "ts", derive(TS))]
8363#[cfg_attr(feature = "ts", ts(export))]
8364pub struct CELLULAR_CONFIG_DATA {
8365 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8366 pub enable_lte: u8,
8367 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8368 pub enable_pin: u8,
8369 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8370 #[cfg_attr(feature = "ts", ts(type = "string"))]
8371 pub pin: CharArray<16>,
8372 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8373 #[cfg_attr(feature = "ts", ts(type = "string"))]
8374 pub new_pin: CharArray<16>,
8375 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8376 #[cfg_attr(feature = "ts", ts(type = "string"))]
8377 pub apn: CharArray<32>,
8378 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8379 #[cfg_attr(feature = "ts", ts(type = "string"))]
8380 pub puk: CharArray<16>,
8381 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8382 pub roaming: u8,
8383 #[doc = "Message acceptance response (sent back to GS)."]
8384 pub response: CellularConfigResponse,
8385}
8386impl CELLULAR_CONFIG_DATA {
8387 pub const ENCODED_LEN: usize = 84usize;
8388 pub const DEFAULT: Self = Self {
8389 enable_lte: 0_u8,
8390 enable_pin: 0_u8,
8391 pin: CharArray::new([0_u8; 16usize]),
8392 new_pin: CharArray::new([0_u8; 16usize]),
8393 apn: CharArray::new([0_u8; 32usize]),
8394 puk: CharArray::new([0_u8; 16usize]),
8395 roaming: 0_u8,
8396 response: CellularConfigResponse::DEFAULT,
8397 };
8398 #[cfg(feature = "arbitrary")]
8399 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8400 use arbitrary::{Arbitrary, Unstructured};
8401 let mut buf = [0u8; 1024];
8402 rng.fill_bytes(&mut buf);
8403 let mut unstructured = Unstructured::new(&buf);
8404 Self::arbitrary(&mut unstructured).unwrap_or_default()
8405 }
8406}
8407impl Default for CELLULAR_CONFIG_DATA {
8408 fn default() -> Self {
8409 Self::DEFAULT.clone()
8410 }
8411}
8412impl MessageData for CELLULAR_CONFIG_DATA {
8413 type Message = MavMessage;
8414 const ID: u32 = 336u32;
8415 const NAME: &'static str = "CELLULAR_CONFIG";
8416 const EXTRA_CRC: u8 = 245u8;
8417 const ENCODED_LEN: usize = 84usize;
8418 fn deser(
8419 _version: MavlinkVersion,
8420 __input: &[u8],
8421 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8422 let avail_len = __input.len();
8423 let mut payload_buf = [0; Self::ENCODED_LEN];
8424 let mut buf = if avail_len < Self::ENCODED_LEN {
8425 payload_buf[0..avail_len].copy_from_slice(__input);
8426 Bytes::new(&payload_buf)
8427 } else {
8428 Bytes::new(__input)
8429 };
8430 let mut __struct = Self::default();
8431 __struct.enable_lte = buf.get_u8();
8432 __struct.enable_pin = buf.get_u8();
8433 let mut tmp = [0_u8; 16usize];
8434 for v in &mut tmp {
8435 *v = buf.get_u8();
8436 }
8437 __struct.pin = CharArray::new(tmp);
8438 let mut tmp = [0_u8; 16usize];
8439 for v in &mut tmp {
8440 *v = buf.get_u8();
8441 }
8442 __struct.new_pin = CharArray::new(tmp);
8443 let mut tmp = [0_u8; 32usize];
8444 for v in &mut tmp {
8445 *v = buf.get_u8();
8446 }
8447 __struct.apn = CharArray::new(tmp);
8448 let mut tmp = [0_u8; 16usize];
8449 for v in &mut tmp {
8450 *v = buf.get_u8();
8451 }
8452 __struct.puk = CharArray::new(tmp);
8453 __struct.roaming = buf.get_u8();
8454 let tmp = buf.get_u8();
8455 __struct.response =
8456 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8457 enum_type: "CellularConfigResponse",
8458 value: tmp as u32,
8459 })?;
8460 Ok(__struct)
8461 }
8462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8463 let mut __tmp = BytesMut::new(bytes);
8464 #[allow(clippy::absurd_extreme_comparisons)]
8465 #[allow(unused_comparisons)]
8466 if __tmp.remaining() < Self::ENCODED_LEN {
8467 panic!(
8468 "buffer is too small (need {} bytes, but got {})",
8469 Self::ENCODED_LEN,
8470 __tmp.remaining(),
8471 )
8472 }
8473 __tmp.put_u8(self.enable_lte);
8474 __tmp.put_u8(self.enable_pin);
8475 for val in &self.pin {
8476 __tmp.put_u8(*val);
8477 }
8478 for val in &self.new_pin {
8479 __tmp.put_u8(*val);
8480 }
8481 for val in &self.apn {
8482 __tmp.put_u8(*val);
8483 }
8484 for val in &self.puk {
8485 __tmp.put_u8(*val);
8486 }
8487 __tmp.put_u8(self.roaming);
8488 __tmp.put_u8(self.response as u8);
8489 if matches!(version, MavlinkVersion::V2) {
8490 let len = __tmp.len();
8491 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8492 } else {
8493 __tmp.len()
8494 }
8495 }
8496}
8497#[doc = "Report current used cellular network status."]
8498#[doc = ""]
8499#[doc = "ID: 334"]
8500#[derive(Debug, Clone, PartialEq)]
8501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8503#[cfg_attr(feature = "ts", derive(TS))]
8504#[cfg_attr(feature = "ts", ts(export))]
8505pub struct CELLULAR_STATUS_DATA {
8506 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8507 pub mcc: u16,
8508 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8509 pub mnc: u16,
8510 #[doc = "Location area code. If unknown, set to 0"]
8511 pub lac: u16,
8512 #[doc = "Cellular modem status"]
8513 pub status: CellularStatusFlag,
8514 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8515 pub failure_reason: CellularNetworkFailedReason,
8516 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8517 pub mavtype: CellularNetworkRadioType,
8518 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8519 pub quality: u8,
8520}
8521impl CELLULAR_STATUS_DATA {
8522 pub const ENCODED_LEN: usize = 10usize;
8523 pub const DEFAULT: Self = Self {
8524 mcc: 0_u16,
8525 mnc: 0_u16,
8526 lac: 0_u16,
8527 status: CellularStatusFlag::DEFAULT,
8528 failure_reason: CellularNetworkFailedReason::DEFAULT,
8529 mavtype: CellularNetworkRadioType::DEFAULT,
8530 quality: 0_u8,
8531 };
8532 #[cfg(feature = "arbitrary")]
8533 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8534 use arbitrary::{Arbitrary, Unstructured};
8535 let mut buf = [0u8; 1024];
8536 rng.fill_bytes(&mut buf);
8537 let mut unstructured = Unstructured::new(&buf);
8538 Self::arbitrary(&mut unstructured).unwrap_or_default()
8539 }
8540}
8541impl Default for CELLULAR_STATUS_DATA {
8542 fn default() -> Self {
8543 Self::DEFAULT.clone()
8544 }
8545}
8546impl MessageData for CELLULAR_STATUS_DATA {
8547 type Message = MavMessage;
8548 const ID: u32 = 334u32;
8549 const NAME: &'static str = "CELLULAR_STATUS";
8550 const EXTRA_CRC: u8 = 72u8;
8551 const ENCODED_LEN: usize = 10usize;
8552 fn deser(
8553 _version: MavlinkVersion,
8554 __input: &[u8],
8555 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8556 let avail_len = __input.len();
8557 let mut payload_buf = [0; Self::ENCODED_LEN];
8558 let mut buf = if avail_len < Self::ENCODED_LEN {
8559 payload_buf[0..avail_len].copy_from_slice(__input);
8560 Bytes::new(&payload_buf)
8561 } else {
8562 Bytes::new(__input)
8563 };
8564 let mut __struct = Self::default();
8565 __struct.mcc = buf.get_u16_le();
8566 __struct.mnc = buf.get_u16_le();
8567 __struct.lac = buf.get_u16_le();
8568 let tmp = buf.get_u8();
8569 __struct.status =
8570 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8571 enum_type: "CellularStatusFlag",
8572 value: tmp as u32,
8573 })?;
8574 let tmp = buf.get_u8();
8575 __struct.failure_reason =
8576 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8577 enum_type: "CellularNetworkFailedReason",
8578 value: tmp as u32,
8579 })?;
8580 let tmp = buf.get_u8();
8581 __struct.mavtype =
8582 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8583 enum_type: "CellularNetworkRadioType",
8584 value: tmp as u32,
8585 })?;
8586 __struct.quality = buf.get_u8();
8587 Ok(__struct)
8588 }
8589 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8590 let mut __tmp = BytesMut::new(bytes);
8591 #[allow(clippy::absurd_extreme_comparisons)]
8592 #[allow(unused_comparisons)]
8593 if __tmp.remaining() < Self::ENCODED_LEN {
8594 panic!(
8595 "buffer is too small (need {} bytes, but got {})",
8596 Self::ENCODED_LEN,
8597 __tmp.remaining(),
8598 )
8599 }
8600 __tmp.put_u16_le(self.mcc);
8601 __tmp.put_u16_le(self.mnc);
8602 __tmp.put_u16_le(self.lac);
8603 __tmp.put_u8(self.status as u8);
8604 __tmp.put_u8(self.failure_reason as u8);
8605 __tmp.put_u8(self.mavtype as u8);
8606 __tmp.put_u8(self.quality);
8607 if matches!(version, MavlinkVersion::V2) {
8608 let len = __tmp.len();
8609 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8610 } else {
8611 __tmp.len()
8612 }
8613 }
8614}
8615#[doc = "Request to control this MAV."]
8616#[doc = ""]
8617#[doc = "ID: 5"]
8618#[derive(Debug, Clone, PartialEq)]
8619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8621#[cfg_attr(feature = "ts", derive(TS))]
8622#[cfg_attr(feature = "ts", ts(export))]
8623pub struct CHANGE_OPERATOR_CONTROL_DATA {
8624 #[doc = "System the GCS requests control for"]
8625 pub target_system: u8,
8626 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8627 pub control_request: u8,
8628 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8629 pub version: u8,
8630 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8631 #[cfg_attr(feature = "ts", ts(type = "string"))]
8632 pub passkey: CharArray<25>,
8633}
8634impl CHANGE_OPERATOR_CONTROL_DATA {
8635 pub const ENCODED_LEN: usize = 28usize;
8636 pub const DEFAULT: Self = Self {
8637 target_system: 0_u8,
8638 control_request: 0_u8,
8639 version: 0_u8,
8640 passkey: CharArray::new([0_u8; 25usize]),
8641 };
8642 #[cfg(feature = "arbitrary")]
8643 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8644 use arbitrary::{Arbitrary, Unstructured};
8645 let mut buf = [0u8; 1024];
8646 rng.fill_bytes(&mut buf);
8647 let mut unstructured = Unstructured::new(&buf);
8648 Self::arbitrary(&mut unstructured).unwrap_or_default()
8649 }
8650}
8651impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8652 fn default() -> Self {
8653 Self::DEFAULT.clone()
8654 }
8655}
8656impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8657 type Message = MavMessage;
8658 const ID: u32 = 5u32;
8659 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8660 const EXTRA_CRC: u8 = 217u8;
8661 const ENCODED_LEN: usize = 28usize;
8662 fn deser(
8663 _version: MavlinkVersion,
8664 __input: &[u8],
8665 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8666 let avail_len = __input.len();
8667 let mut payload_buf = [0; Self::ENCODED_LEN];
8668 let mut buf = if avail_len < Self::ENCODED_LEN {
8669 payload_buf[0..avail_len].copy_from_slice(__input);
8670 Bytes::new(&payload_buf)
8671 } else {
8672 Bytes::new(__input)
8673 };
8674 let mut __struct = Self::default();
8675 __struct.target_system = buf.get_u8();
8676 __struct.control_request = buf.get_u8();
8677 __struct.version = buf.get_u8();
8678 let mut tmp = [0_u8; 25usize];
8679 for v in &mut tmp {
8680 *v = buf.get_u8();
8681 }
8682 __struct.passkey = CharArray::new(tmp);
8683 Ok(__struct)
8684 }
8685 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8686 let mut __tmp = BytesMut::new(bytes);
8687 #[allow(clippy::absurd_extreme_comparisons)]
8688 #[allow(unused_comparisons)]
8689 if __tmp.remaining() < Self::ENCODED_LEN {
8690 panic!(
8691 "buffer is too small (need {} bytes, but got {})",
8692 Self::ENCODED_LEN,
8693 __tmp.remaining(),
8694 )
8695 }
8696 __tmp.put_u8(self.target_system);
8697 __tmp.put_u8(self.control_request);
8698 __tmp.put_u8(self.version);
8699 for val in &self.passkey {
8700 __tmp.put_u8(*val);
8701 }
8702 if matches!(version, MavlinkVersion::V2) {
8703 let len = __tmp.len();
8704 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8705 } else {
8706 __tmp.len()
8707 }
8708 }
8709}
8710#[doc = "Accept / deny control of this MAV."]
8711#[doc = ""]
8712#[doc = "ID: 6"]
8713#[derive(Debug, Clone, PartialEq)]
8714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8715#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8716#[cfg_attr(feature = "ts", derive(TS))]
8717#[cfg_attr(feature = "ts", ts(export))]
8718pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8719 #[doc = "ID of the GCS this message"]
8720 pub gcs_system_id: u8,
8721 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8722 pub control_request: u8,
8723 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8724 pub ack: u8,
8725}
8726impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8727 pub const ENCODED_LEN: usize = 3usize;
8728 pub const DEFAULT: Self = Self {
8729 gcs_system_id: 0_u8,
8730 control_request: 0_u8,
8731 ack: 0_u8,
8732 };
8733 #[cfg(feature = "arbitrary")]
8734 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8735 use arbitrary::{Arbitrary, Unstructured};
8736 let mut buf = [0u8; 1024];
8737 rng.fill_bytes(&mut buf);
8738 let mut unstructured = Unstructured::new(&buf);
8739 Self::arbitrary(&mut unstructured).unwrap_or_default()
8740 }
8741}
8742impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8743 fn default() -> Self {
8744 Self::DEFAULT.clone()
8745 }
8746}
8747impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8748 type Message = MavMessage;
8749 const ID: u32 = 6u32;
8750 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8751 const EXTRA_CRC: u8 = 104u8;
8752 const ENCODED_LEN: usize = 3usize;
8753 fn deser(
8754 _version: MavlinkVersion,
8755 __input: &[u8],
8756 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8757 let avail_len = __input.len();
8758 let mut payload_buf = [0; Self::ENCODED_LEN];
8759 let mut buf = if avail_len < Self::ENCODED_LEN {
8760 payload_buf[0..avail_len].copy_from_slice(__input);
8761 Bytes::new(&payload_buf)
8762 } else {
8763 Bytes::new(__input)
8764 };
8765 let mut __struct = Self::default();
8766 __struct.gcs_system_id = buf.get_u8();
8767 __struct.control_request = buf.get_u8();
8768 __struct.ack = buf.get_u8();
8769 Ok(__struct)
8770 }
8771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8772 let mut __tmp = BytesMut::new(bytes);
8773 #[allow(clippy::absurd_extreme_comparisons)]
8774 #[allow(unused_comparisons)]
8775 if __tmp.remaining() < Self::ENCODED_LEN {
8776 panic!(
8777 "buffer is too small (need {} bytes, but got {})",
8778 Self::ENCODED_LEN,
8779 __tmp.remaining(),
8780 )
8781 }
8782 __tmp.put_u8(self.gcs_system_id);
8783 __tmp.put_u8(self.control_request);
8784 __tmp.put_u8(self.ack);
8785 if matches!(version, MavlinkVersion::V2) {
8786 let len = __tmp.len();
8787 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8788 } else {
8789 __tmp.len()
8790 }
8791 }
8792}
8793#[doc = "Information about a potential collision."]
8794#[doc = ""]
8795#[doc = "ID: 247"]
8796#[derive(Debug, Clone, PartialEq)]
8797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8798#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8799#[cfg_attr(feature = "ts", derive(TS))]
8800#[cfg_attr(feature = "ts", ts(export))]
8801pub struct COLLISION_DATA {
8802 #[doc = "Unique identifier, domain based on src field"]
8803 pub id: u32,
8804 #[doc = "Estimated time until collision occurs"]
8805 pub time_to_minimum_delta: f32,
8806 #[doc = "Closest vertical distance between vehicle and object"]
8807 pub altitude_minimum_delta: f32,
8808 #[doc = "Closest horizontal distance between vehicle and object"]
8809 pub horizontal_minimum_delta: f32,
8810 #[doc = "Collision data source"]
8811 pub src: MavCollisionSrc,
8812 #[doc = "Action that is being taken to avoid this collision"]
8813 pub action: MavCollisionAction,
8814 #[doc = "How concerned the aircraft is about this collision"]
8815 pub threat_level: MavCollisionThreatLevel,
8816}
8817impl COLLISION_DATA {
8818 pub const ENCODED_LEN: usize = 19usize;
8819 pub const DEFAULT: Self = Self {
8820 id: 0_u32,
8821 time_to_minimum_delta: 0.0_f32,
8822 altitude_minimum_delta: 0.0_f32,
8823 horizontal_minimum_delta: 0.0_f32,
8824 src: MavCollisionSrc::DEFAULT,
8825 action: MavCollisionAction::DEFAULT,
8826 threat_level: MavCollisionThreatLevel::DEFAULT,
8827 };
8828 #[cfg(feature = "arbitrary")]
8829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8830 use arbitrary::{Arbitrary, Unstructured};
8831 let mut buf = [0u8; 1024];
8832 rng.fill_bytes(&mut buf);
8833 let mut unstructured = Unstructured::new(&buf);
8834 Self::arbitrary(&mut unstructured).unwrap_or_default()
8835 }
8836}
8837impl Default for COLLISION_DATA {
8838 fn default() -> Self {
8839 Self::DEFAULT.clone()
8840 }
8841}
8842impl MessageData for COLLISION_DATA {
8843 type Message = MavMessage;
8844 const ID: u32 = 247u32;
8845 const NAME: &'static str = "COLLISION";
8846 const EXTRA_CRC: u8 = 81u8;
8847 const ENCODED_LEN: usize = 19usize;
8848 fn deser(
8849 _version: MavlinkVersion,
8850 __input: &[u8],
8851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8852 let avail_len = __input.len();
8853 let mut payload_buf = [0; Self::ENCODED_LEN];
8854 let mut buf = if avail_len < Self::ENCODED_LEN {
8855 payload_buf[0..avail_len].copy_from_slice(__input);
8856 Bytes::new(&payload_buf)
8857 } else {
8858 Bytes::new(__input)
8859 };
8860 let mut __struct = Self::default();
8861 __struct.id = buf.get_u32_le();
8862 __struct.time_to_minimum_delta = buf.get_f32_le();
8863 __struct.altitude_minimum_delta = buf.get_f32_le();
8864 __struct.horizontal_minimum_delta = buf.get_f32_le();
8865 let tmp = buf.get_u8();
8866 __struct.src =
8867 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8868 enum_type: "MavCollisionSrc",
8869 value: tmp as u32,
8870 })?;
8871 let tmp = buf.get_u8();
8872 __struct.action =
8873 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8874 enum_type: "MavCollisionAction",
8875 value: tmp as u32,
8876 })?;
8877 let tmp = buf.get_u8();
8878 __struct.threat_level =
8879 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8880 enum_type: "MavCollisionThreatLevel",
8881 value: tmp as u32,
8882 })?;
8883 Ok(__struct)
8884 }
8885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8886 let mut __tmp = BytesMut::new(bytes);
8887 #[allow(clippy::absurd_extreme_comparisons)]
8888 #[allow(unused_comparisons)]
8889 if __tmp.remaining() < Self::ENCODED_LEN {
8890 panic!(
8891 "buffer is too small (need {} bytes, but got {})",
8892 Self::ENCODED_LEN,
8893 __tmp.remaining(),
8894 )
8895 }
8896 __tmp.put_u32_le(self.id);
8897 __tmp.put_f32_le(self.time_to_minimum_delta);
8898 __tmp.put_f32_le(self.altitude_minimum_delta);
8899 __tmp.put_f32_le(self.horizontal_minimum_delta);
8900 __tmp.put_u8(self.src as u8);
8901 __tmp.put_u8(self.action as u8);
8902 __tmp.put_u8(self.threat_level as u8);
8903 if matches!(version, MavlinkVersion::V2) {
8904 let len = __tmp.len();
8905 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8906 } else {
8907 __tmp.len()
8908 }
8909 }
8910}
8911#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8912#[doc = ""]
8913#[doc = "ID: 77"]
8914#[derive(Debug, Clone, PartialEq)]
8915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8917#[cfg_attr(feature = "ts", derive(TS))]
8918#[cfg_attr(feature = "ts", ts(export))]
8919pub struct COMMAND_ACK_DATA {
8920 #[doc = "Command ID (of acknowledged command)."]
8921 pub command: MavCmd,
8922 #[doc = "Result of command."]
8923 pub result: MavResult,
8924 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8925 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8926 pub progress: u8,
8927 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8928 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8929 pub result_param2: i32,
8930 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8932 pub target_system: u8,
8933 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8934 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8935 pub target_component: u8,
8936}
8937impl COMMAND_ACK_DATA {
8938 pub const ENCODED_LEN: usize = 10usize;
8939 pub const DEFAULT: Self = Self {
8940 command: MavCmd::DEFAULT,
8941 result: MavResult::DEFAULT,
8942 progress: 0_u8,
8943 result_param2: 0_i32,
8944 target_system: 0_u8,
8945 target_component: 0_u8,
8946 };
8947 #[cfg(feature = "arbitrary")]
8948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8949 use arbitrary::{Arbitrary, Unstructured};
8950 let mut buf = [0u8; 1024];
8951 rng.fill_bytes(&mut buf);
8952 let mut unstructured = Unstructured::new(&buf);
8953 Self::arbitrary(&mut unstructured).unwrap_or_default()
8954 }
8955}
8956impl Default for COMMAND_ACK_DATA {
8957 fn default() -> Self {
8958 Self::DEFAULT.clone()
8959 }
8960}
8961impl MessageData for COMMAND_ACK_DATA {
8962 type Message = MavMessage;
8963 const ID: u32 = 77u32;
8964 const NAME: &'static str = "COMMAND_ACK";
8965 const EXTRA_CRC: u8 = 143u8;
8966 const ENCODED_LEN: usize = 10usize;
8967 fn deser(
8968 _version: MavlinkVersion,
8969 __input: &[u8],
8970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8971 let avail_len = __input.len();
8972 let mut payload_buf = [0; Self::ENCODED_LEN];
8973 let mut buf = if avail_len < Self::ENCODED_LEN {
8974 payload_buf[0..avail_len].copy_from_slice(__input);
8975 Bytes::new(&payload_buf)
8976 } else {
8977 Bytes::new(__input)
8978 };
8979 let mut __struct = Self::default();
8980 let tmp = buf.get_u16_le();
8981 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8982 ::mavlink_core::error::ParserError::InvalidEnum {
8983 enum_type: "MavCmd",
8984 value: tmp as u32,
8985 },
8986 )?;
8987 let tmp = buf.get_u8();
8988 __struct.result =
8989 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8990 enum_type: "MavResult",
8991 value: tmp as u32,
8992 })?;
8993 __struct.progress = buf.get_u8();
8994 __struct.result_param2 = buf.get_i32_le();
8995 __struct.target_system = buf.get_u8();
8996 __struct.target_component = buf.get_u8();
8997 Ok(__struct)
8998 }
8999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9000 let mut __tmp = BytesMut::new(bytes);
9001 #[allow(clippy::absurd_extreme_comparisons)]
9002 #[allow(unused_comparisons)]
9003 if __tmp.remaining() < Self::ENCODED_LEN {
9004 panic!(
9005 "buffer is too small (need {} bytes, but got {})",
9006 Self::ENCODED_LEN,
9007 __tmp.remaining(),
9008 )
9009 }
9010 __tmp.put_u16_le(self.command as u16);
9011 __tmp.put_u8(self.result as u8);
9012 if matches!(version, MavlinkVersion::V2) {
9013 __tmp.put_u8(self.progress);
9014 __tmp.put_i32_le(self.result_param2);
9015 __tmp.put_u8(self.target_system);
9016 __tmp.put_u8(self.target_component);
9017 let len = __tmp.len();
9018 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9019 } else {
9020 __tmp.len()
9021 }
9022 }
9023}
9024#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9025#[doc = ""]
9026#[doc = "ID: 80"]
9027#[derive(Debug, Clone, PartialEq)]
9028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9029#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9030#[cfg_attr(feature = "ts", derive(TS))]
9031#[cfg_attr(feature = "ts", ts(export))]
9032pub struct COMMAND_CANCEL_DATA {
9033 #[doc = "Command ID (of command to cancel)."]
9034 pub command: MavCmd,
9035 #[doc = "System executing long running command. Should not be broadcast (0)."]
9036 pub target_system: u8,
9037 #[doc = "Component executing long running command."]
9038 pub target_component: u8,
9039}
9040impl COMMAND_CANCEL_DATA {
9041 pub const ENCODED_LEN: usize = 4usize;
9042 pub const DEFAULT: Self = Self {
9043 command: MavCmd::DEFAULT,
9044 target_system: 0_u8,
9045 target_component: 0_u8,
9046 };
9047 #[cfg(feature = "arbitrary")]
9048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9049 use arbitrary::{Arbitrary, Unstructured};
9050 let mut buf = [0u8; 1024];
9051 rng.fill_bytes(&mut buf);
9052 let mut unstructured = Unstructured::new(&buf);
9053 Self::arbitrary(&mut unstructured).unwrap_or_default()
9054 }
9055}
9056impl Default for COMMAND_CANCEL_DATA {
9057 fn default() -> Self {
9058 Self::DEFAULT.clone()
9059 }
9060}
9061impl MessageData for COMMAND_CANCEL_DATA {
9062 type Message = MavMessage;
9063 const ID: u32 = 80u32;
9064 const NAME: &'static str = "COMMAND_CANCEL";
9065 const EXTRA_CRC: u8 = 14u8;
9066 const ENCODED_LEN: usize = 4usize;
9067 fn deser(
9068 _version: MavlinkVersion,
9069 __input: &[u8],
9070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9071 let avail_len = __input.len();
9072 let mut payload_buf = [0; Self::ENCODED_LEN];
9073 let mut buf = if avail_len < Self::ENCODED_LEN {
9074 payload_buf[0..avail_len].copy_from_slice(__input);
9075 Bytes::new(&payload_buf)
9076 } else {
9077 Bytes::new(__input)
9078 };
9079 let mut __struct = Self::default();
9080 let tmp = buf.get_u16_le();
9081 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9082 ::mavlink_core::error::ParserError::InvalidEnum {
9083 enum_type: "MavCmd",
9084 value: tmp as u32,
9085 },
9086 )?;
9087 __struct.target_system = buf.get_u8();
9088 __struct.target_component = buf.get_u8();
9089 Ok(__struct)
9090 }
9091 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9092 let mut __tmp = BytesMut::new(bytes);
9093 #[allow(clippy::absurd_extreme_comparisons)]
9094 #[allow(unused_comparisons)]
9095 if __tmp.remaining() < Self::ENCODED_LEN {
9096 panic!(
9097 "buffer is too small (need {} bytes, but got {})",
9098 Self::ENCODED_LEN,
9099 __tmp.remaining(),
9100 )
9101 }
9102 __tmp.put_u16_le(self.command as u16);
9103 __tmp.put_u8(self.target_system);
9104 __tmp.put_u8(self.target_component);
9105 if matches!(version, MavlinkVersion::V2) {
9106 let len = __tmp.len();
9107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9108 } else {
9109 __tmp.len()
9110 }
9111 }
9112}
9113#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9114#[doc = ""]
9115#[doc = "ID: 75"]
9116#[derive(Debug, Clone, PartialEq)]
9117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9119#[cfg_attr(feature = "ts", derive(TS))]
9120#[cfg_attr(feature = "ts", ts(export))]
9121pub struct COMMAND_INT_DATA {
9122 #[doc = "PARAM1, see MAV_CMD enum"]
9123 pub param1: f32,
9124 #[doc = "PARAM2, see MAV_CMD enum"]
9125 pub param2: f32,
9126 #[doc = "PARAM3, see MAV_CMD enum"]
9127 pub param3: f32,
9128 #[doc = "PARAM4, see MAV_CMD enum"]
9129 pub param4: f32,
9130 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9131 pub x: i32,
9132 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9133 pub y: i32,
9134 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9135 pub z: f32,
9136 #[doc = "The scheduled action for the mission item."]
9137 pub command: MavCmd,
9138 #[doc = "System ID"]
9139 pub target_system: u8,
9140 #[doc = "Component ID"]
9141 pub target_component: u8,
9142 #[doc = "The coordinate system of the COMMAND."]
9143 pub frame: MavFrame,
9144 #[doc = "Not used."]
9145 pub current: u8,
9146 #[doc = "Not used (set 0)."]
9147 pub autocontinue: u8,
9148}
9149impl COMMAND_INT_DATA {
9150 pub const ENCODED_LEN: usize = 35usize;
9151 pub const DEFAULT: Self = Self {
9152 param1: 0.0_f32,
9153 param2: 0.0_f32,
9154 param3: 0.0_f32,
9155 param4: 0.0_f32,
9156 x: 0_i32,
9157 y: 0_i32,
9158 z: 0.0_f32,
9159 command: MavCmd::DEFAULT,
9160 target_system: 0_u8,
9161 target_component: 0_u8,
9162 frame: MavFrame::DEFAULT,
9163 current: 0_u8,
9164 autocontinue: 0_u8,
9165 };
9166 #[cfg(feature = "arbitrary")]
9167 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9168 use arbitrary::{Arbitrary, Unstructured};
9169 let mut buf = [0u8; 1024];
9170 rng.fill_bytes(&mut buf);
9171 let mut unstructured = Unstructured::new(&buf);
9172 Self::arbitrary(&mut unstructured).unwrap_or_default()
9173 }
9174}
9175impl Default for COMMAND_INT_DATA {
9176 fn default() -> Self {
9177 Self::DEFAULT.clone()
9178 }
9179}
9180impl MessageData for COMMAND_INT_DATA {
9181 type Message = MavMessage;
9182 const ID: u32 = 75u32;
9183 const NAME: &'static str = "COMMAND_INT";
9184 const EXTRA_CRC: u8 = 158u8;
9185 const ENCODED_LEN: usize = 35usize;
9186 fn deser(
9187 _version: MavlinkVersion,
9188 __input: &[u8],
9189 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9190 let avail_len = __input.len();
9191 let mut payload_buf = [0; Self::ENCODED_LEN];
9192 let mut buf = if avail_len < Self::ENCODED_LEN {
9193 payload_buf[0..avail_len].copy_from_slice(__input);
9194 Bytes::new(&payload_buf)
9195 } else {
9196 Bytes::new(__input)
9197 };
9198 let mut __struct = Self::default();
9199 __struct.param1 = buf.get_f32_le();
9200 __struct.param2 = buf.get_f32_le();
9201 __struct.param3 = buf.get_f32_le();
9202 __struct.param4 = buf.get_f32_le();
9203 __struct.x = buf.get_i32_le();
9204 __struct.y = buf.get_i32_le();
9205 __struct.z = buf.get_f32_le();
9206 let tmp = buf.get_u16_le();
9207 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9208 ::mavlink_core::error::ParserError::InvalidEnum {
9209 enum_type: "MavCmd",
9210 value: tmp as u32,
9211 },
9212 )?;
9213 __struct.target_system = buf.get_u8();
9214 __struct.target_component = buf.get_u8();
9215 let tmp = buf.get_u8();
9216 __struct.frame =
9217 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9218 enum_type: "MavFrame",
9219 value: tmp as u32,
9220 })?;
9221 __struct.current = buf.get_u8();
9222 __struct.autocontinue = buf.get_u8();
9223 Ok(__struct)
9224 }
9225 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9226 let mut __tmp = BytesMut::new(bytes);
9227 #[allow(clippy::absurd_extreme_comparisons)]
9228 #[allow(unused_comparisons)]
9229 if __tmp.remaining() < Self::ENCODED_LEN {
9230 panic!(
9231 "buffer is too small (need {} bytes, but got {})",
9232 Self::ENCODED_LEN,
9233 __tmp.remaining(),
9234 )
9235 }
9236 __tmp.put_f32_le(self.param1);
9237 __tmp.put_f32_le(self.param2);
9238 __tmp.put_f32_le(self.param3);
9239 __tmp.put_f32_le(self.param4);
9240 __tmp.put_i32_le(self.x);
9241 __tmp.put_i32_le(self.y);
9242 __tmp.put_f32_le(self.z);
9243 __tmp.put_u16_le(self.command as u16);
9244 __tmp.put_u8(self.target_system);
9245 __tmp.put_u8(self.target_component);
9246 __tmp.put_u8(self.frame as u8);
9247 __tmp.put_u8(self.current);
9248 __tmp.put_u8(self.autocontinue);
9249 if matches!(version, MavlinkVersion::V2) {
9250 let len = __tmp.len();
9251 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9252 } else {
9253 __tmp.len()
9254 }
9255 }
9256}
9257#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9258#[doc = ""]
9259#[doc = "ID: 76"]
9260#[derive(Debug, Clone, PartialEq)]
9261#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9262#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9263#[cfg_attr(feature = "ts", derive(TS))]
9264#[cfg_attr(feature = "ts", ts(export))]
9265pub struct COMMAND_LONG_DATA {
9266 #[doc = "Parameter 1 (for the specific command)."]
9267 pub param1: f32,
9268 #[doc = "Parameter 2 (for the specific command)."]
9269 pub param2: f32,
9270 #[doc = "Parameter 3 (for the specific command)."]
9271 pub param3: f32,
9272 #[doc = "Parameter 4 (for the specific command)."]
9273 pub param4: f32,
9274 #[doc = "Parameter 5 (for the specific command)."]
9275 pub param5: f32,
9276 #[doc = "Parameter 6 (for the specific command)."]
9277 pub param6: f32,
9278 #[doc = "Parameter 7 (for the specific command)."]
9279 pub param7: f32,
9280 #[doc = "Command ID (of command to send)."]
9281 pub command: MavCmd,
9282 #[doc = "System which should execute the command"]
9283 pub target_system: u8,
9284 #[doc = "Component which should execute the command, 0 for all components"]
9285 pub target_component: u8,
9286 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9287 pub confirmation: u8,
9288}
9289impl COMMAND_LONG_DATA {
9290 pub const ENCODED_LEN: usize = 33usize;
9291 pub const DEFAULT: Self = Self {
9292 param1: 0.0_f32,
9293 param2: 0.0_f32,
9294 param3: 0.0_f32,
9295 param4: 0.0_f32,
9296 param5: 0.0_f32,
9297 param6: 0.0_f32,
9298 param7: 0.0_f32,
9299 command: MavCmd::DEFAULT,
9300 target_system: 0_u8,
9301 target_component: 0_u8,
9302 confirmation: 0_u8,
9303 };
9304 #[cfg(feature = "arbitrary")]
9305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9306 use arbitrary::{Arbitrary, Unstructured};
9307 let mut buf = [0u8; 1024];
9308 rng.fill_bytes(&mut buf);
9309 let mut unstructured = Unstructured::new(&buf);
9310 Self::arbitrary(&mut unstructured).unwrap_or_default()
9311 }
9312}
9313impl Default for COMMAND_LONG_DATA {
9314 fn default() -> Self {
9315 Self::DEFAULT.clone()
9316 }
9317}
9318impl MessageData for COMMAND_LONG_DATA {
9319 type Message = MavMessage;
9320 const ID: u32 = 76u32;
9321 const NAME: &'static str = "COMMAND_LONG";
9322 const EXTRA_CRC: u8 = 152u8;
9323 const ENCODED_LEN: usize = 33usize;
9324 fn deser(
9325 _version: MavlinkVersion,
9326 __input: &[u8],
9327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9328 let avail_len = __input.len();
9329 let mut payload_buf = [0; Self::ENCODED_LEN];
9330 let mut buf = if avail_len < Self::ENCODED_LEN {
9331 payload_buf[0..avail_len].copy_from_slice(__input);
9332 Bytes::new(&payload_buf)
9333 } else {
9334 Bytes::new(__input)
9335 };
9336 let mut __struct = Self::default();
9337 __struct.param1 = buf.get_f32_le();
9338 __struct.param2 = buf.get_f32_le();
9339 __struct.param3 = buf.get_f32_le();
9340 __struct.param4 = buf.get_f32_le();
9341 __struct.param5 = buf.get_f32_le();
9342 __struct.param6 = buf.get_f32_le();
9343 __struct.param7 = buf.get_f32_le();
9344 let tmp = buf.get_u16_le();
9345 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9346 ::mavlink_core::error::ParserError::InvalidEnum {
9347 enum_type: "MavCmd",
9348 value: tmp as u32,
9349 },
9350 )?;
9351 __struct.target_system = buf.get_u8();
9352 __struct.target_component = buf.get_u8();
9353 __struct.confirmation = buf.get_u8();
9354 Ok(__struct)
9355 }
9356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9357 let mut __tmp = BytesMut::new(bytes);
9358 #[allow(clippy::absurd_extreme_comparisons)]
9359 #[allow(unused_comparisons)]
9360 if __tmp.remaining() < Self::ENCODED_LEN {
9361 panic!(
9362 "buffer is too small (need {} bytes, but got {})",
9363 Self::ENCODED_LEN,
9364 __tmp.remaining(),
9365 )
9366 }
9367 __tmp.put_f32_le(self.param1);
9368 __tmp.put_f32_le(self.param2);
9369 __tmp.put_f32_le(self.param3);
9370 __tmp.put_f32_le(self.param4);
9371 __tmp.put_f32_le(self.param5);
9372 __tmp.put_f32_le(self.param6);
9373 __tmp.put_f32_le(self.param7);
9374 __tmp.put_u16_le(self.command as u16);
9375 __tmp.put_u8(self.target_system);
9376 __tmp.put_u8(self.target_component);
9377 __tmp.put_u8(self.confirmation);
9378 if matches!(version, MavlinkVersion::V2) {
9379 let len = __tmp.len();
9380 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9381 } else {
9382 __tmp.len()
9383 }
9384 }
9385}
9386#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9387#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9388#[doc = ""]
9389#[doc = "ID: 395"]
9390#[derive(Debug, Clone, PartialEq)]
9391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9393#[cfg_attr(feature = "ts", derive(TS))]
9394#[cfg_attr(feature = "ts", ts(export))]
9395pub struct COMPONENT_INFORMATION_DATA {
9396 #[doc = "Timestamp (time since system boot)."]
9397 pub time_boot_ms: u32,
9398 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9399 pub general_metadata_file_crc: u32,
9400 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9401 pub peripherals_metadata_file_crc: u32,
9402 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9403 #[cfg_attr(feature = "ts", ts(type = "string"))]
9404 pub general_metadata_uri: CharArray<100>,
9405 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9406 #[cfg_attr(feature = "ts", ts(type = "string"))]
9407 pub peripherals_metadata_uri: CharArray<100>,
9408}
9409impl COMPONENT_INFORMATION_DATA {
9410 pub const ENCODED_LEN: usize = 212usize;
9411 pub const DEFAULT: Self = Self {
9412 time_boot_ms: 0_u32,
9413 general_metadata_file_crc: 0_u32,
9414 peripherals_metadata_file_crc: 0_u32,
9415 general_metadata_uri: CharArray::new([0_u8; 100usize]),
9416 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
9417 };
9418 #[cfg(feature = "arbitrary")]
9419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9420 use arbitrary::{Arbitrary, Unstructured};
9421 let mut buf = [0u8; 1024];
9422 rng.fill_bytes(&mut buf);
9423 let mut unstructured = Unstructured::new(&buf);
9424 Self::arbitrary(&mut unstructured).unwrap_or_default()
9425 }
9426}
9427impl Default for COMPONENT_INFORMATION_DATA {
9428 fn default() -> Self {
9429 Self::DEFAULT.clone()
9430 }
9431}
9432impl MessageData for COMPONENT_INFORMATION_DATA {
9433 type Message = MavMessage;
9434 const ID: u32 = 395u32;
9435 const NAME: &'static str = "COMPONENT_INFORMATION";
9436 const EXTRA_CRC: u8 = 0u8;
9437 const ENCODED_LEN: usize = 212usize;
9438 fn deser(
9439 _version: MavlinkVersion,
9440 __input: &[u8],
9441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9442 let avail_len = __input.len();
9443 let mut payload_buf = [0; Self::ENCODED_LEN];
9444 let mut buf = if avail_len < Self::ENCODED_LEN {
9445 payload_buf[0..avail_len].copy_from_slice(__input);
9446 Bytes::new(&payload_buf)
9447 } else {
9448 Bytes::new(__input)
9449 };
9450 let mut __struct = Self::default();
9451 __struct.time_boot_ms = buf.get_u32_le();
9452 __struct.general_metadata_file_crc = buf.get_u32_le();
9453 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9454 let mut tmp = [0_u8; 100usize];
9455 for v in &mut tmp {
9456 *v = buf.get_u8();
9457 }
9458 __struct.general_metadata_uri = CharArray::new(tmp);
9459 let mut tmp = [0_u8; 100usize];
9460 for v in &mut tmp {
9461 *v = buf.get_u8();
9462 }
9463 __struct.peripherals_metadata_uri = CharArray::new(tmp);
9464 Ok(__struct)
9465 }
9466 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9467 let mut __tmp = BytesMut::new(bytes);
9468 #[allow(clippy::absurd_extreme_comparisons)]
9469 #[allow(unused_comparisons)]
9470 if __tmp.remaining() < Self::ENCODED_LEN {
9471 panic!(
9472 "buffer is too small (need {} bytes, but got {})",
9473 Self::ENCODED_LEN,
9474 __tmp.remaining(),
9475 )
9476 }
9477 __tmp.put_u32_le(self.time_boot_ms);
9478 __tmp.put_u32_le(self.general_metadata_file_crc);
9479 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9480 for val in &self.general_metadata_uri {
9481 __tmp.put_u8(*val);
9482 }
9483 for val in &self.peripherals_metadata_uri {
9484 __tmp.put_u8(*val);
9485 }
9486 if matches!(version, MavlinkVersion::V2) {
9487 let len = __tmp.len();
9488 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9489 } else {
9490 __tmp.len()
9491 }
9492 }
9493}
9494#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9495#[doc = ""]
9496#[doc = "ID: 396"]
9497#[derive(Debug, Clone, PartialEq)]
9498#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9500#[cfg_attr(feature = "ts", derive(TS))]
9501#[cfg_attr(feature = "ts", ts(export))]
9502pub struct COMPONENT_INFORMATION_BASIC_DATA {
9503 #[doc = "Component capability flags"]
9504 pub capabilities: MavProtocolCapability,
9505 #[doc = "Timestamp (time since system boot)."]
9506 pub time_boot_ms: u32,
9507 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9508 pub time_manufacture_s: u32,
9509 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9510 #[cfg_attr(feature = "ts", ts(type = "string"))]
9511 pub vendor_name: CharArray<32>,
9512 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9513 #[cfg_attr(feature = "ts", ts(type = "string"))]
9514 pub model_name: CharArray<32>,
9515 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9516 #[cfg_attr(feature = "ts", ts(type = "string"))]
9517 pub software_version: CharArray<24>,
9518 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9519 #[cfg_attr(feature = "ts", ts(type = "string"))]
9520 pub hardware_version: CharArray<24>,
9521 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9522 #[cfg_attr(feature = "ts", ts(type = "string"))]
9523 pub serial_number: CharArray<32>,
9524}
9525impl COMPONENT_INFORMATION_BASIC_DATA {
9526 pub const ENCODED_LEN: usize = 160usize;
9527 pub const DEFAULT: Self = Self {
9528 capabilities: MavProtocolCapability::DEFAULT,
9529 time_boot_ms: 0_u32,
9530 time_manufacture_s: 0_u32,
9531 vendor_name: CharArray::new([0_u8; 32usize]),
9532 model_name: CharArray::new([0_u8; 32usize]),
9533 software_version: CharArray::new([0_u8; 24usize]),
9534 hardware_version: CharArray::new([0_u8; 24usize]),
9535 serial_number: CharArray::new([0_u8; 32usize]),
9536 };
9537 #[cfg(feature = "arbitrary")]
9538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9539 use arbitrary::{Arbitrary, Unstructured};
9540 let mut buf = [0u8; 1024];
9541 rng.fill_bytes(&mut buf);
9542 let mut unstructured = Unstructured::new(&buf);
9543 Self::arbitrary(&mut unstructured).unwrap_or_default()
9544 }
9545}
9546impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9547 fn default() -> Self {
9548 Self::DEFAULT.clone()
9549 }
9550}
9551impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9552 type Message = MavMessage;
9553 const ID: u32 = 396u32;
9554 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9555 const EXTRA_CRC: u8 = 50u8;
9556 const ENCODED_LEN: usize = 160usize;
9557 fn deser(
9558 _version: MavlinkVersion,
9559 __input: &[u8],
9560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9561 let avail_len = __input.len();
9562 let mut payload_buf = [0; Self::ENCODED_LEN];
9563 let mut buf = if avail_len < Self::ENCODED_LEN {
9564 payload_buf[0..avail_len].copy_from_slice(__input);
9565 Bytes::new(&payload_buf)
9566 } else {
9567 Bytes::new(__input)
9568 };
9569 let mut __struct = Self::default();
9570 let tmp = buf.get_u64_le();
9571 __struct.capabilities = MavProtocolCapability::from_bits(
9572 tmp & MavProtocolCapability::all().bits(),
9573 )
9574 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9575 flag_type: "MavProtocolCapability",
9576 value: tmp as u32,
9577 })?;
9578 __struct.time_boot_ms = buf.get_u32_le();
9579 __struct.time_manufacture_s = buf.get_u32_le();
9580 let mut tmp = [0_u8; 32usize];
9581 for v in &mut tmp {
9582 *v = buf.get_u8();
9583 }
9584 __struct.vendor_name = CharArray::new(tmp);
9585 let mut tmp = [0_u8; 32usize];
9586 for v in &mut tmp {
9587 *v = buf.get_u8();
9588 }
9589 __struct.model_name = CharArray::new(tmp);
9590 let mut tmp = [0_u8; 24usize];
9591 for v in &mut tmp {
9592 *v = buf.get_u8();
9593 }
9594 __struct.software_version = CharArray::new(tmp);
9595 let mut tmp = [0_u8; 24usize];
9596 for v in &mut tmp {
9597 *v = buf.get_u8();
9598 }
9599 __struct.hardware_version = CharArray::new(tmp);
9600 let mut tmp = [0_u8; 32usize];
9601 for v in &mut tmp {
9602 *v = buf.get_u8();
9603 }
9604 __struct.serial_number = CharArray::new(tmp);
9605 Ok(__struct)
9606 }
9607 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9608 let mut __tmp = BytesMut::new(bytes);
9609 #[allow(clippy::absurd_extreme_comparisons)]
9610 #[allow(unused_comparisons)]
9611 if __tmp.remaining() < Self::ENCODED_LEN {
9612 panic!(
9613 "buffer is too small (need {} bytes, but got {})",
9614 Self::ENCODED_LEN,
9615 __tmp.remaining(),
9616 )
9617 }
9618 __tmp.put_u64_le(self.capabilities.bits());
9619 __tmp.put_u32_le(self.time_boot_ms);
9620 __tmp.put_u32_le(self.time_manufacture_s);
9621 for val in &self.vendor_name {
9622 __tmp.put_u8(*val);
9623 }
9624 for val in &self.model_name {
9625 __tmp.put_u8(*val);
9626 }
9627 for val in &self.software_version {
9628 __tmp.put_u8(*val);
9629 }
9630 for val in &self.hardware_version {
9631 __tmp.put_u8(*val);
9632 }
9633 for val in &self.serial_number {
9634 __tmp.put_u8(*val);
9635 }
9636 if matches!(version, MavlinkVersion::V2) {
9637 let len = __tmp.len();
9638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9639 } else {
9640 __tmp.len()
9641 }
9642 }
9643}
9644#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9645#[doc = ""]
9646#[doc = "ID: 397"]
9647#[derive(Debug, Clone, PartialEq)]
9648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9650#[cfg_attr(feature = "ts", derive(TS))]
9651#[cfg_attr(feature = "ts", ts(export))]
9652pub struct COMPONENT_METADATA_DATA {
9653 #[doc = "Timestamp (time since system boot)."]
9654 pub time_boot_ms: u32,
9655 #[doc = "CRC32 of the general metadata file."]
9656 pub file_crc: u32,
9657 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9658 #[cfg_attr(feature = "ts", ts(type = "string"))]
9659 pub uri: CharArray<100>,
9660}
9661impl COMPONENT_METADATA_DATA {
9662 pub const ENCODED_LEN: usize = 108usize;
9663 pub const DEFAULT: Self = Self {
9664 time_boot_ms: 0_u32,
9665 file_crc: 0_u32,
9666 uri: CharArray::new([0_u8; 100usize]),
9667 };
9668 #[cfg(feature = "arbitrary")]
9669 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9670 use arbitrary::{Arbitrary, Unstructured};
9671 let mut buf = [0u8; 1024];
9672 rng.fill_bytes(&mut buf);
9673 let mut unstructured = Unstructured::new(&buf);
9674 Self::arbitrary(&mut unstructured).unwrap_or_default()
9675 }
9676}
9677impl Default for COMPONENT_METADATA_DATA {
9678 fn default() -> Self {
9679 Self::DEFAULT.clone()
9680 }
9681}
9682impl MessageData for COMPONENT_METADATA_DATA {
9683 type Message = MavMessage;
9684 const ID: u32 = 397u32;
9685 const NAME: &'static str = "COMPONENT_METADATA";
9686 const EXTRA_CRC: u8 = 182u8;
9687 const ENCODED_LEN: usize = 108usize;
9688 fn deser(
9689 _version: MavlinkVersion,
9690 __input: &[u8],
9691 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9692 let avail_len = __input.len();
9693 let mut payload_buf = [0; Self::ENCODED_LEN];
9694 let mut buf = if avail_len < Self::ENCODED_LEN {
9695 payload_buf[0..avail_len].copy_from_slice(__input);
9696 Bytes::new(&payload_buf)
9697 } else {
9698 Bytes::new(__input)
9699 };
9700 let mut __struct = Self::default();
9701 __struct.time_boot_ms = buf.get_u32_le();
9702 __struct.file_crc = buf.get_u32_le();
9703 let mut tmp = [0_u8; 100usize];
9704 for v in &mut tmp {
9705 *v = buf.get_u8();
9706 }
9707 __struct.uri = CharArray::new(tmp);
9708 Ok(__struct)
9709 }
9710 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9711 let mut __tmp = BytesMut::new(bytes);
9712 #[allow(clippy::absurd_extreme_comparisons)]
9713 #[allow(unused_comparisons)]
9714 if __tmp.remaining() < Self::ENCODED_LEN {
9715 panic!(
9716 "buffer is too small (need {} bytes, but got {})",
9717 Self::ENCODED_LEN,
9718 __tmp.remaining(),
9719 )
9720 }
9721 __tmp.put_u32_le(self.time_boot_ms);
9722 __tmp.put_u32_le(self.file_crc);
9723 for val in &self.uri {
9724 __tmp.put_u8(*val);
9725 }
9726 if matches!(version, MavlinkVersion::V2) {
9727 let len = __tmp.len();
9728 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9729 } else {
9730 __tmp.len()
9731 }
9732 }
9733}
9734#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9735#[doc = ""]
9736#[doc = "ID: 146"]
9737#[derive(Debug, Clone, PartialEq)]
9738#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9739#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9740#[cfg_attr(feature = "ts", derive(TS))]
9741#[cfg_attr(feature = "ts", ts(export))]
9742pub struct CONTROL_SYSTEM_STATE_DATA {
9743 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9744 pub time_usec: u64,
9745 #[doc = "X acceleration in body frame"]
9746 pub x_acc: f32,
9747 #[doc = "Y acceleration in body frame"]
9748 pub y_acc: f32,
9749 #[doc = "Z acceleration in body frame"]
9750 pub z_acc: f32,
9751 #[doc = "X velocity in body frame"]
9752 pub x_vel: f32,
9753 #[doc = "Y velocity in body frame"]
9754 pub y_vel: f32,
9755 #[doc = "Z velocity in body frame"]
9756 pub z_vel: f32,
9757 #[doc = "X position in local frame"]
9758 pub x_pos: f32,
9759 #[doc = "Y position in local frame"]
9760 pub y_pos: f32,
9761 #[doc = "Z position in local frame"]
9762 pub z_pos: f32,
9763 #[doc = "Airspeed, set to -1 if unknown"]
9764 pub airspeed: f32,
9765 #[doc = "Variance of body velocity estimate"]
9766 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9767 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9768 pub vel_variance: [f32; 3],
9769 #[doc = "Variance in local position"]
9770 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9771 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9772 pub pos_variance: [f32; 3],
9773 #[doc = "The attitude, represented as Quaternion"]
9774 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9775 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9776 pub q: [f32; 4],
9777 #[doc = "Angular rate in roll axis"]
9778 pub roll_rate: f32,
9779 #[doc = "Angular rate in pitch axis"]
9780 pub pitch_rate: f32,
9781 #[doc = "Angular rate in yaw axis"]
9782 pub yaw_rate: f32,
9783}
9784impl CONTROL_SYSTEM_STATE_DATA {
9785 pub const ENCODED_LEN: usize = 100usize;
9786 pub const DEFAULT: Self = Self {
9787 time_usec: 0_u64,
9788 x_acc: 0.0_f32,
9789 y_acc: 0.0_f32,
9790 z_acc: 0.0_f32,
9791 x_vel: 0.0_f32,
9792 y_vel: 0.0_f32,
9793 z_vel: 0.0_f32,
9794 x_pos: 0.0_f32,
9795 y_pos: 0.0_f32,
9796 z_pos: 0.0_f32,
9797 airspeed: 0.0_f32,
9798 vel_variance: [0.0_f32; 3usize],
9799 pos_variance: [0.0_f32; 3usize],
9800 q: [0.0_f32; 4usize],
9801 roll_rate: 0.0_f32,
9802 pitch_rate: 0.0_f32,
9803 yaw_rate: 0.0_f32,
9804 };
9805 #[cfg(feature = "arbitrary")]
9806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9807 use arbitrary::{Arbitrary, Unstructured};
9808 let mut buf = [0u8; 1024];
9809 rng.fill_bytes(&mut buf);
9810 let mut unstructured = Unstructured::new(&buf);
9811 Self::arbitrary(&mut unstructured).unwrap_or_default()
9812 }
9813}
9814impl Default for CONTROL_SYSTEM_STATE_DATA {
9815 fn default() -> Self {
9816 Self::DEFAULT.clone()
9817 }
9818}
9819impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9820 type Message = MavMessage;
9821 const ID: u32 = 146u32;
9822 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9823 const EXTRA_CRC: u8 = 103u8;
9824 const ENCODED_LEN: usize = 100usize;
9825 fn deser(
9826 _version: MavlinkVersion,
9827 __input: &[u8],
9828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9829 let avail_len = __input.len();
9830 let mut payload_buf = [0; Self::ENCODED_LEN];
9831 let mut buf = if avail_len < Self::ENCODED_LEN {
9832 payload_buf[0..avail_len].copy_from_slice(__input);
9833 Bytes::new(&payload_buf)
9834 } else {
9835 Bytes::new(__input)
9836 };
9837 let mut __struct = Self::default();
9838 __struct.time_usec = buf.get_u64_le();
9839 __struct.x_acc = buf.get_f32_le();
9840 __struct.y_acc = buf.get_f32_le();
9841 __struct.z_acc = buf.get_f32_le();
9842 __struct.x_vel = buf.get_f32_le();
9843 __struct.y_vel = buf.get_f32_le();
9844 __struct.z_vel = buf.get_f32_le();
9845 __struct.x_pos = buf.get_f32_le();
9846 __struct.y_pos = buf.get_f32_le();
9847 __struct.z_pos = buf.get_f32_le();
9848 __struct.airspeed = buf.get_f32_le();
9849 for v in &mut __struct.vel_variance {
9850 let val = buf.get_f32_le();
9851 *v = val;
9852 }
9853 for v in &mut __struct.pos_variance {
9854 let val = buf.get_f32_le();
9855 *v = val;
9856 }
9857 for v in &mut __struct.q {
9858 let val = buf.get_f32_le();
9859 *v = val;
9860 }
9861 __struct.roll_rate = buf.get_f32_le();
9862 __struct.pitch_rate = buf.get_f32_le();
9863 __struct.yaw_rate = buf.get_f32_le();
9864 Ok(__struct)
9865 }
9866 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9867 let mut __tmp = BytesMut::new(bytes);
9868 #[allow(clippy::absurd_extreme_comparisons)]
9869 #[allow(unused_comparisons)]
9870 if __tmp.remaining() < Self::ENCODED_LEN {
9871 panic!(
9872 "buffer is too small (need {} bytes, but got {})",
9873 Self::ENCODED_LEN,
9874 __tmp.remaining(),
9875 )
9876 }
9877 __tmp.put_u64_le(self.time_usec);
9878 __tmp.put_f32_le(self.x_acc);
9879 __tmp.put_f32_le(self.y_acc);
9880 __tmp.put_f32_le(self.z_acc);
9881 __tmp.put_f32_le(self.x_vel);
9882 __tmp.put_f32_le(self.y_vel);
9883 __tmp.put_f32_le(self.z_vel);
9884 __tmp.put_f32_le(self.x_pos);
9885 __tmp.put_f32_le(self.y_pos);
9886 __tmp.put_f32_le(self.z_pos);
9887 __tmp.put_f32_le(self.airspeed);
9888 for val in &self.vel_variance {
9889 __tmp.put_f32_le(*val);
9890 }
9891 for val in &self.pos_variance {
9892 __tmp.put_f32_le(*val);
9893 }
9894 for val in &self.q {
9895 __tmp.put_f32_le(*val);
9896 }
9897 __tmp.put_f32_le(self.roll_rate);
9898 __tmp.put_f32_le(self.pitch_rate);
9899 __tmp.put_f32_le(self.yaw_rate);
9900 if matches!(version, MavlinkVersion::V2) {
9901 let len = __tmp.len();
9902 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9903 } else {
9904 __tmp.len()
9905 }
9906 }
9907}
9908#[doc = "offset response to encapsulated data."]
9909#[doc = ""]
9910#[doc = "ID: 50005"]
9911#[derive(Debug, Clone, PartialEq)]
9912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9914#[cfg_attr(feature = "ts", derive(TS))]
9915#[cfg_attr(feature = "ts", ts(export))]
9916pub struct CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9917 #[doc = "FW Offset."]
9918 pub offset: u32,
9919 #[doc = "System ID."]
9920 pub target_system: u8,
9921 #[doc = "Component ID."]
9922 pub target_component: u8,
9923}
9924impl CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9925 pub const ENCODED_LEN: usize = 6usize;
9926 pub const DEFAULT: Self = Self {
9927 offset: 0_u32,
9928 target_system: 0_u8,
9929 target_component: 0_u8,
9930 };
9931 #[cfg(feature = "arbitrary")]
9932 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9933 use arbitrary::{Arbitrary, Unstructured};
9934 let mut buf = [0u8; 1024];
9935 rng.fill_bytes(&mut buf);
9936 let mut unstructured = Unstructured::new(&buf);
9937 Self::arbitrary(&mut unstructured).unwrap_or_default()
9938 }
9939}
9940impl Default for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9941 fn default() -> Self {
9942 Self::DEFAULT.clone()
9943 }
9944}
9945impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9946 type Message = MavMessage;
9947 const ID: u32 = 50005u32;
9948 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_RESP";
9949 const EXTRA_CRC: u8 = 152u8;
9950 const ENCODED_LEN: usize = 6usize;
9951 fn deser(
9952 _version: MavlinkVersion,
9953 __input: &[u8],
9954 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9955 let avail_len = __input.len();
9956 let mut payload_buf = [0; Self::ENCODED_LEN];
9957 let mut buf = if avail_len < Self::ENCODED_LEN {
9958 payload_buf[0..avail_len].copy_from_slice(__input);
9959 Bytes::new(&payload_buf)
9960 } else {
9961 Bytes::new(__input)
9962 };
9963 let mut __struct = Self::default();
9964 __struct.offset = buf.get_u32_le();
9965 __struct.target_system = buf.get_u8();
9966 __struct.target_component = buf.get_u8();
9967 Ok(__struct)
9968 }
9969 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9970 let mut __tmp = BytesMut::new(bytes);
9971 #[allow(clippy::absurd_extreme_comparisons)]
9972 #[allow(unused_comparisons)]
9973 if __tmp.remaining() < Self::ENCODED_LEN {
9974 panic!(
9975 "buffer is too small (need {} bytes, but got {})",
9976 Self::ENCODED_LEN,
9977 __tmp.remaining(),
9978 )
9979 }
9980 __tmp.put_u32_le(self.offset);
9981 __tmp.put_u8(self.target_system);
9982 __tmp.put_u8(self.target_component);
9983 if matches!(version, MavlinkVersion::V2) {
9984 let len = __tmp.len();
9985 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9986 } else {
9987 __tmp.len()
9988 }
9989 }
9990}
9991#[doc = "Start firmware update with encapsulated data."]
9992#[doc = ""]
9993#[doc = "ID: 50004"]
9994#[derive(Debug, Clone, PartialEq)]
9995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9997#[cfg_attr(feature = "ts", derive(TS))]
9998#[cfg_attr(feature = "ts", ts(export))]
9999pub struct CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10000 #[doc = "FW Size."]
10001 pub size: u32,
10002 #[doc = "FW CRC."]
10003 pub crc: u32,
10004 #[doc = "System ID."]
10005 pub target_system: u8,
10006 #[doc = "Component ID."]
10007 pub target_component: u8,
10008}
10009impl CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10010 pub const ENCODED_LEN: usize = 10usize;
10011 pub const DEFAULT: Self = Self {
10012 size: 0_u32,
10013 crc: 0_u32,
10014 target_system: 0_u8,
10015 target_component: 0_u8,
10016 };
10017 #[cfg(feature = "arbitrary")]
10018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10019 use arbitrary::{Arbitrary, Unstructured};
10020 let mut buf = [0u8; 1024];
10021 rng.fill_bytes(&mut buf);
10022 let mut unstructured = Unstructured::new(&buf);
10023 Self::arbitrary(&mut unstructured).unwrap_or_default()
10024 }
10025}
10026impl Default for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10027 fn default() -> Self {
10028 Self::DEFAULT.clone()
10029 }
10030}
10031impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10032 type Message = MavMessage;
10033 const ID: u32 = 50004u32;
10034 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_START";
10035 const EXTRA_CRC: u8 = 240u8;
10036 const ENCODED_LEN: usize = 10usize;
10037 fn deser(
10038 _version: MavlinkVersion,
10039 __input: &[u8],
10040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10041 let avail_len = __input.len();
10042 let mut payload_buf = [0; Self::ENCODED_LEN];
10043 let mut buf = if avail_len < Self::ENCODED_LEN {
10044 payload_buf[0..avail_len].copy_from_slice(__input);
10045 Bytes::new(&payload_buf)
10046 } else {
10047 Bytes::new(__input)
10048 };
10049 let mut __struct = Self::default();
10050 __struct.size = buf.get_u32_le();
10051 __struct.crc = buf.get_u32_le();
10052 __struct.target_system = buf.get_u8();
10053 __struct.target_component = buf.get_u8();
10054 Ok(__struct)
10055 }
10056 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10057 let mut __tmp = BytesMut::new(bytes);
10058 #[allow(clippy::absurd_extreme_comparisons)]
10059 #[allow(unused_comparisons)]
10060 if __tmp.remaining() < Self::ENCODED_LEN {
10061 panic!(
10062 "buffer is too small (need {} bytes, but got {})",
10063 Self::ENCODED_LEN,
10064 __tmp.remaining(),
10065 )
10066 }
10067 __tmp.put_u32_le(self.size);
10068 __tmp.put_u32_le(self.crc);
10069 __tmp.put_u8(self.target_system);
10070 __tmp.put_u8(self.target_component);
10071 if matches!(version, MavlinkVersion::V2) {
10072 let len = __tmp.len();
10073 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10074 } else {
10075 __tmp.len()
10076 }
10077 }
10078}
10079#[doc = "Raw RC Data."]
10080#[doc = ""]
10081#[doc = "ID: 50001"]
10082#[derive(Debug, Clone, PartialEq)]
10083#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10084#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10085#[cfg_attr(feature = "ts", derive(TS))]
10086#[cfg_attr(feature = "ts", ts(export))]
10087pub struct CUBEPILOT_RAW_RC_DATA {
10088 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10089 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10090 pub rc_raw: [u8; 32],
10091}
10092impl CUBEPILOT_RAW_RC_DATA {
10093 pub const ENCODED_LEN: usize = 32usize;
10094 pub const DEFAULT: Self = Self {
10095 rc_raw: [0_u8; 32usize],
10096 };
10097 #[cfg(feature = "arbitrary")]
10098 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10099 use arbitrary::{Arbitrary, Unstructured};
10100 let mut buf = [0u8; 1024];
10101 rng.fill_bytes(&mut buf);
10102 let mut unstructured = Unstructured::new(&buf);
10103 Self::arbitrary(&mut unstructured).unwrap_or_default()
10104 }
10105}
10106impl Default for CUBEPILOT_RAW_RC_DATA {
10107 fn default() -> Self {
10108 Self::DEFAULT.clone()
10109 }
10110}
10111impl MessageData for CUBEPILOT_RAW_RC_DATA {
10112 type Message = MavMessage;
10113 const ID: u32 = 50001u32;
10114 const NAME: &'static str = "CUBEPILOT_RAW_RC";
10115 const EXTRA_CRC: u8 = 246u8;
10116 const ENCODED_LEN: usize = 32usize;
10117 fn deser(
10118 _version: MavlinkVersion,
10119 __input: &[u8],
10120 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10121 let avail_len = __input.len();
10122 let mut payload_buf = [0; Self::ENCODED_LEN];
10123 let mut buf = if avail_len < Self::ENCODED_LEN {
10124 payload_buf[0..avail_len].copy_from_slice(__input);
10125 Bytes::new(&payload_buf)
10126 } else {
10127 Bytes::new(__input)
10128 };
10129 let mut __struct = Self::default();
10130 for v in &mut __struct.rc_raw {
10131 let val = buf.get_u8();
10132 *v = val;
10133 }
10134 Ok(__struct)
10135 }
10136 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10137 let mut __tmp = BytesMut::new(bytes);
10138 #[allow(clippy::absurd_extreme_comparisons)]
10139 #[allow(unused_comparisons)]
10140 if __tmp.remaining() < Self::ENCODED_LEN {
10141 panic!(
10142 "buffer is too small (need {} bytes, but got {})",
10143 Self::ENCODED_LEN,
10144 __tmp.remaining(),
10145 )
10146 }
10147 for val in &self.rc_raw {
10148 __tmp.put_u8(*val);
10149 }
10150 if matches!(version, MavlinkVersion::V2) {
10151 let len = __tmp.len();
10152 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10153 } else {
10154 __tmp.len()
10155 }
10156 }
10157}
10158#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10159#[doc = ""]
10160#[doc = "ID: 411"]
10161#[derive(Debug, Clone, PartialEq)]
10162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10164#[cfg_attr(feature = "ts", derive(TS))]
10165#[cfg_attr(feature = "ts", ts(export))]
10166pub struct CURRENT_EVENT_SEQUENCE_DATA {
10167 #[doc = "Sequence number."]
10168 pub sequence: u16,
10169 #[doc = "Flag bitset."]
10170 pub flags: MavEventCurrentSequenceFlags,
10171}
10172impl CURRENT_EVENT_SEQUENCE_DATA {
10173 pub const ENCODED_LEN: usize = 3usize;
10174 pub const DEFAULT: Self = Self {
10175 sequence: 0_u16,
10176 flags: MavEventCurrentSequenceFlags::DEFAULT,
10177 };
10178 #[cfg(feature = "arbitrary")]
10179 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10180 use arbitrary::{Arbitrary, Unstructured};
10181 let mut buf = [0u8; 1024];
10182 rng.fill_bytes(&mut buf);
10183 let mut unstructured = Unstructured::new(&buf);
10184 Self::arbitrary(&mut unstructured).unwrap_or_default()
10185 }
10186}
10187impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10188 fn default() -> Self {
10189 Self::DEFAULT.clone()
10190 }
10191}
10192impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10193 type Message = MavMessage;
10194 const ID: u32 = 411u32;
10195 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10196 const EXTRA_CRC: u8 = 106u8;
10197 const ENCODED_LEN: usize = 3usize;
10198 fn deser(
10199 _version: MavlinkVersion,
10200 __input: &[u8],
10201 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10202 let avail_len = __input.len();
10203 let mut payload_buf = [0; Self::ENCODED_LEN];
10204 let mut buf = if avail_len < Self::ENCODED_LEN {
10205 payload_buf[0..avail_len].copy_from_slice(__input);
10206 Bytes::new(&payload_buf)
10207 } else {
10208 Bytes::new(__input)
10209 };
10210 let mut __struct = Self::default();
10211 __struct.sequence = buf.get_u16_le();
10212 let tmp = buf.get_u8();
10213 __struct.flags =
10214 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10215 enum_type: "MavEventCurrentSequenceFlags",
10216 value: tmp as u32,
10217 })?;
10218 Ok(__struct)
10219 }
10220 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10221 let mut __tmp = BytesMut::new(bytes);
10222 #[allow(clippy::absurd_extreme_comparisons)]
10223 #[allow(unused_comparisons)]
10224 if __tmp.remaining() < Self::ENCODED_LEN {
10225 panic!(
10226 "buffer is too small (need {} bytes, but got {})",
10227 Self::ENCODED_LEN,
10228 __tmp.remaining(),
10229 )
10230 }
10231 __tmp.put_u16_le(self.sequence);
10232 __tmp.put_u8(self.flags as u8);
10233 if matches!(version, MavlinkVersion::V2) {
10234 let len = __tmp.len();
10235 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10236 } else {
10237 __tmp.len()
10238 }
10239 }
10240}
10241#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10242#[doc = ""]
10243#[doc = "ID: 436"]
10244#[derive(Debug, Clone, PartialEq)]
10245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10247#[cfg_attr(feature = "ts", derive(TS))]
10248#[cfg_attr(feature = "ts", ts(export))]
10249pub struct CURRENT_MODE_DATA {
10250 #[doc = "A bitfield for use for autopilot-specific flags"]
10251 pub custom_mode: u32,
10252 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10253 pub intended_custom_mode: u32,
10254 #[doc = "Standard mode."]
10255 pub standard_mode: MavStandardMode,
10256}
10257impl CURRENT_MODE_DATA {
10258 pub const ENCODED_LEN: usize = 9usize;
10259 pub const DEFAULT: Self = Self {
10260 custom_mode: 0_u32,
10261 intended_custom_mode: 0_u32,
10262 standard_mode: MavStandardMode::DEFAULT,
10263 };
10264 #[cfg(feature = "arbitrary")]
10265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10266 use arbitrary::{Arbitrary, Unstructured};
10267 let mut buf = [0u8; 1024];
10268 rng.fill_bytes(&mut buf);
10269 let mut unstructured = Unstructured::new(&buf);
10270 Self::arbitrary(&mut unstructured).unwrap_or_default()
10271 }
10272}
10273impl Default for CURRENT_MODE_DATA {
10274 fn default() -> Self {
10275 Self::DEFAULT.clone()
10276 }
10277}
10278impl MessageData for CURRENT_MODE_DATA {
10279 type Message = MavMessage;
10280 const ID: u32 = 436u32;
10281 const NAME: &'static str = "CURRENT_MODE";
10282 const EXTRA_CRC: u8 = 193u8;
10283 const ENCODED_LEN: usize = 9usize;
10284 fn deser(
10285 _version: MavlinkVersion,
10286 __input: &[u8],
10287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10288 let avail_len = __input.len();
10289 let mut payload_buf = [0; Self::ENCODED_LEN];
10290 let mut buf = if avail_len < Self::ENCODED_LEN {
10291 payload_buf[0..avail_len].copy_from_slice(__input);
10292 Bytes::new(&payload_buf)
10293 } else {
10294 Bytes::new(__input)
10295 };
10296 let mut __struct = Self::default();
10297 __struct.custom_mode = buf.get_u32_le();
10298 __struct.intended_custom_mode = buf.get_u32_le();
10299 let tmp = buf.get_u8();
10300 __struct.standard_mode =
10301 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10302 enum_type: "MavStandardMode",
10303 value: tmp as u32,
10304 })?;
10305 Ok(__struct)
10306 }
10307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10308 let mut __tmp = BytesMut::new(bytes);
10309 #[allow(clippy::absurd_extreme_comparisons)]
10310 #[allow(unused_comparisons)]
10311 if __tmp.remaining() < Self::ENCODED_LEN {
10312 panic!(
10313 "buffer is too small (need {} bytes, but got {})",
10314 Self::ENCODED_LEN,
10315 __tmp.remaining(),
10316 )
10317 }
10318 __tmp.put_u32_le(self.custom_mode);
10319 __tmp.put_u32_le(self.intended_custom_mode);
10320 __tmp.put_u8(self.standard_mode as u8);
10321 if matches!(version, MavlinkVersion::V2) {
10322 let len = __tmp.len();
10323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10324 } else {
10325 __tmp.len()
10326 }
10327 }
10328}
10329#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10330#[doc = "Data stream status information."]
10331#[doc = ""]
10332#[doc = "ID: 67"]
10333#[derive(Debug, Clone, PartialEq)]
10334#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10335#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10336#[cfg_attr(feature = "ts", derive(TS))]
10337#[cfg_attr(feature = "ts", ts(export))]
10338pub struct DATA_STREAM_DATA {
10339 #[doc = "The message rate"]
10340 pub message_rate: u16,
10341 #[doc = "The ID of the requested data stream"]
10342 pub stream_id: u8,
10343 #[doc = "1 stream is enabled, 0 stream is stopped."]
10344 pub on_off: u8,
10345}
10346impl DATA_STREAM_DATA {
10347 pub const ENCODED_LEN: usize = 4usize;
10348 pub const DEFAULT: Self = Self {
10349 message_rate: 0_u16,
10350 stream_id: 0_u8,
10351 on_off: 0_u8,
10352 };
10353 #[cfg(feature = "arbitrary")]
10354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10355 use arbitrary::{Arbitrary, Unstructured};
10356 let mut buf = [0u8; 1024];
10357 rng.fill_bytes(&mut buf);
10358 let mut unstructured = Unstructured::new(&buf);
10359 Self::arbitrary(&mut unstructured).unwrap_or_default()
10360 }
10361}
10362impl Default for DATA_STREAM_DATA {
10363 fn default() -> Self {
10364 Self::DEFAULT.clone()
10365 }
10366}
10367impl MessageData for DATA_STREAM_DATA {
10368 type Message = MavMessage;
10369 const ID: u32 = 67u32;
10370 const NAME: &'static str = "DATA_STREAM";
10371 const EXTRA_CRC: u8 = 21u8;
10372 const ENCODED_LEN: usize = 4usize;
10373 fn deser(
10374 _version: MavlinkVersion,
10375 __input: &[u8],
10376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10377 let avail_len = __input.len();
10378 let mut payload_buf = [0; Self::ENCODED_LEN];
10379 let mut buf = if avail_len < Self::ENCODED_LEN {
10380 payload_buf[0..avail_len].copy_from_slice(__input);
10381 Bytes::new(&payload_buf)
10382 } else {
10383 Bytes::new(__input)
10384 };
10385 let mut __struct = Self::default();
10386 __struct.message_rate = buf.get_u16_le();
10387 __struct.stream_id = buf.get_u8();
10388 __struct.on_off = buf.get_u8();
10389 Ok(__struct)
10390 }
10391 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10392 let mut __tmp = BytesMut::new(bytes);
10393 #[allow(clippy::absurd_extreme_comparisons)]
10394 #[allow(unused_comparisons)]
10395 if __tmp.remaining() < Self::ENCODED_LEN {
10396 panic!(
10397 "buffer is too small (need {} bytes, but got {})",
10398 Self::ENCODED_LEN,
10399 __tmp.remaining(),
10400 )
10401 }
10402 __tmp.put_u16_le(self.message_rate);
10403 __tmp.put_u8(self.stream_id);
10404 __tmp.put_u8(self.on_off);
10405 if matches!(version, MavlinkVersion::V2) {
10406 let len = __tmp.len();
10407 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10408 } else {
10409 __tmp.len()
10410 }
10411 }
10412}
10413#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10414#[doc = ""]
10415#[doc = "ID: 130"]
10416#[derive(Debug, Clone, PartialEq)]
10417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10418#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10419#[cfg_attr(feature = "ts", derive(TS))]
10420#[cfg_attr(feature = "ts", ts(export))]
10421pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10422 #[doc = "total data size (set on ACK only)."]
10423 pub size: u32,
10424 #[doc = "Width of a matrix or image."]
10425 pub width: u16,
10426 #[doc = "Height of a matrix or image."]
10427 pub height: u16,
10428 #[doc = "Number of packets being sent (set on ACK only)."]
10429 pub packets: u16,
10430 #[doc = "Type of requested/acknowledged data."]
10431 pub mavtype: MavlinkDataStreamType,
10432 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10433 pub payload: u8,
10434 #[doc = "JPEG quality. Values: [1-100]."]
10435 pub jpg_quality: u8,
10436}
10437impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10438 pub const ENCODED_LEN: usize = 13usize;
10439 pub const DEFAULT: Self = Self {
10440 size: 0_u32,
10441 width: 0_u16,
10442 height: 0_u16,
10443 packets: 0_u16,
10444 mavtype: MavlinkDataStreamType::DEFAULT,
10445 payload: 0_u8,
10446 jpg_quality: 0_u8,
10447 };
10448 #[cfg(feature = "arbitrary")]
10449 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10450 use arbitrary::{Arbitrary, Unstructured};
10451 let mut buf = [0u8; 1024];
10452 rng.fill_bytes(&mut buf);
10453 let mut unstructured = Unstructured::new(&buf);
10454 Self::arbitrary(&mut unstructured).unwrap_or_default()
10455 }
10456}
10457impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10458 fn default() -> Self {
10459 Self::DEFAULT.clone()
10460 }
10461}
10462impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10463 type Message = MavMessage;
10464 const ID: u32 = 130u32;
10465 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10466 const EXTRA_CRC: u8 = 29u8;
10467 const ENCODED_LEN: usize = 13usize;
10468 fn deser(
10469 _version: MavlinkVersion,
10470 __input: &[u8],
10471 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10472 let avail_len = __input.len();
10473 let mut payload_buf = [0; Self::ENCODED_LEN];
10474 let mut buf = if avail_len < Self::ENCODED_LEN {
10475 payload_buf[0..avail_len].copy_from_slice(__input);
10476 Bytes::new(&payload_buf)
10477 } else {
10478 Bytes::new(__input)
10479 };
10480 let mut __struct = Self::default();
10481 __struct.size = buf.get_u32_le();
10482 __struct.width = buf.get_u16_le();
10483 __struct.height = buf.get_u16_le();
10484 __struct.packets = buf.get_u16_le();
10485 let tmp = buf.get_u8();
10486 __struct.mavtype =
10487 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10488 enum_type: "MavlinkDataStreamType",
10489 value: tmp as u32,
10490 })?;
10491 __struct.payload = buf.get_u8();
10492 __struct.jpg_quality = buf.get_u8();
10493 Ok(__struct)
10494 }
10495 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10496 let mut __tmp = BytesMut::new(bytes);
10497 #[allow(clippy::absurd_extreme_comparisons)]
10498 #[allow(unused_comparisons)]
10499 if __tmp.remaining() < Self::ENCODED_LEN {
10500 panic!(
10501 "buffer is too small (need {} bytes, but got {})",
10502 Self::ENCODED_LEN,
10503 __tmp.remaining(),
10504 )
10505 }
10506 __tmp.put_u32_le(self.size);
10507 __tmp.put_u16_le(self.width);
10508 __tmp.put_u16_le(self.height);
10509 __tmp.put_u16_le(self.packets);
10510 __tmp.put_u8(self.mavtype as u8);
10511 __tmp.put_u8(self.payload);
10512 __tmp.put_u8(self.jpg_quality);
10513 if matches!(version, MavlinkVersion::V2) {
10514 let len = __tmp.len();
10515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10516 } else {
10517 __tmp.len()
10518 }
10519 }
10520}
10521#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10522#[doc = ""]
10523#[doc = "ID: 254"]
10524#[derive(Debug, Clone, PartialEq)]
10525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10527#[cfg_attr(feature = "ts", derive(TS))]
10528#[cfg_attr(feature = "ts", ts(export))]
10529pub struct DEBUG_DATA {
10530 #[doc = "Timestamp (time since system boot)."]
10531 pub time_boot_ms: u32,
10532 #[doc = "DEBUG value"]
10533 pub value: f32,
10534 #[doc = "index of debug variable"]
10535 pub ind: u8,
10536}
10537impl DEBUG_DATA {
10538 pub const ENCODED_LEN: usize = 9usize;
10539 pub const DEFAULT: Self = Self {
10540 time_boot_ms: 0_u32,
10541 value: 0.0_f32,
10542 ind: 0_u8,
10543 };
10544 #[cfg(feature = "arbitrary")]
10545 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10546 use arbitrary::{Arbitrary, Unstructured};
10547 let mut buf = [0u8; 1024];
10548 rng.fill_bytes(&mut buf);
10549 let mut unstructured = Unstructured::new(&buf);
10550 Self::arbitrary(&mut unstructured).unwrap_or_default()
10551 }
10552}
10553impl Default for DEBUG_DATA {
10554 fn default() -> Self {
10555 Self::DEFAULT.clone()
10556 }
10557}
10558impl MessageData for DEBUG_DATA {
10559 type Message = MavMessage;
10560 const ID: u32 = 254u32;
10561 const NAME: &'static str = "DEBUG";
10562 const EXTRA_CRC: u8 = 46u8;
10563 const ENCODED_LEN: usize = 9usize;
10564 fn deser(
10565 _version: MavlinkVersion,
10566 __input: &[u8],
10567 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10568 let avail_len = __input.len();
10569 let mut payload_buf = [0; Self::ENCODED_LEN];
10570 let mut buf = if avail_len < Self::ENCODED_LEN {
10571 payload_buf[0..avail_len].copy_from_slice(__input);
10572 Bytes::new(&payload_buf)
10573 } else {
10574 Bytes::new(__input)
10575 };
10576 let mut __struct = Self::default();
10577 __struct.time_boot_ms = buf.get_u32_le();
10578 __struct.value = buf.get_f32_le();
10579 __struct.ind = buf.get_u8();
10580 Ok(__struct)
10581 }
10582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10583 let mut __tmp = BytesMut::new(bytes);
10584 #[allow(clippy::absurd_extreme_comparisons)]
10585 #[allow(unused_comparisons)]
10586 if __tmp.remaining() < Self::ENCODED_LEN {
10587 panic!(
10588 "buffer is too small (need {} bytes, but got {})",
10589 Self::ENCODED_LEN,
10590 __tmp.remaining(),
10591 )
10592 }
10593 __tmp.put_u32_le(self.time_boot_ms);
10594 __tmp.put_f32_le(self.value);
10595 __tmp.put_u8(self.ind);
10596 if matches!(version, MavlinkVersion::V2) {
10597 let len = __tmp.len();
10598 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10599 } else {
10600 __tmp.len()
10601 }
10602 }
10603}
10604#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10605#[doc = ""]
10606#[doc = "ID: 350"]
10607#[derive(Debug, Clone, PartialEq)]
10608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10609#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10610#[cfg_attr(feature = "ts", derive(TS))]
10611#[cfg_attr(feature = "ts", ts(export))]
10612pub struct DEBUG_FLOAT_ARRAY_DATA {
10613 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10614 pub time_usec: u64,
10615 #[doc = "Unique ID used to discriminate between arrays"]
10616 pub array_id: u16,
10617 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10618 #[cfg_attr(feature = "ts", ts(type = "string"))]
10619 pub name: CharArray<10>,
10620 #[doc = "data"]
10621 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10622 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10623 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10624 pub data: [f32; 58],
10625}
10626impl DEBUG_FLOAT_ARRAY_DATA {
10627 pub const ENCODED_LEN: usize = 252usize;
10628 pub const DEFAULT: Self = Self {
10629 time_usec: 0_u64,
10630 array_id: 0_u16,
10631 name: CharArray::new([0_u8; 10usize]),
10632 data: [0.0_f32; 58usize],
10633 };
10634 #[cfg(feature = "arbitrary")]
10635 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10636 use arbitrary::{Arbitrary, Unstructured};
10637 let mut buf = [0u8; 1024];
10638 rng.fill_bytes(&mut buf);
10639 let mut unstructured = Unstructured::new(&buf);
10640 Self::arbitrary(&mut unstructured).unwrap_or_default()
10641 }
10642}
10643impl Default for DEBUG_FLOAT_ARRAY_DATA {
10644 fn default() -> Self {
10645 Self::DEFAULT.clone()
10646 }
10647}
10648impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10649 type Message = MavMessage;
10650 const ID: u32 = 350u32;
10651 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10652 const EXTRA_CRC: u8 = 232u8;
10653 const ENCODED_LEN: usize = 252usize;
10654 fn deser(
10655 _version: MavlinkVersion,
10656 __input: &[u8],
10657 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10658 let avail_len = __input.len();
10659 let mut payload_buf = [0; Self::ENCODED_LEN];
10660 let mut buf = if avail_len < Self::ENCODED_LEN {
10661 payload_buf[0..avail_len].copy_from_slice(__input);
10662 Bytes::new(&payload_buf)
10663 } else {
10664 Bytes::new(__input)
10665 };
10666 let mut __struct = Self::default();
10667 __struct.time_usec = buf.get_u64_le();
10668 __struct.array_id = buf.get_u16_le();
10669 let mut tmp = [0_u8; 10usize];
10670 for v in &mut tmp {
10671 *v = buf.get_u8();
10672 }
10673 __struct.name = CharArray::new(tmp);
10674 for v in &mut __struct.data {
10675 let val = buf.get_f32_le();
10676 *v = val;
10677 }
10678 Ok(__struct)
10679 }
10680 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10681 let mut __tmp = BytesMut::new(bytes);
10682 #[allow(clippy::absurd_extreme_comparisons)]
10683 #[allow(unused_comparisons)]
10684 if __tmp.remaining() < Self::ENCODED_LEN {
10685 panic!(
10686 "buffer is too small (need {} bytes, but got {})",
10687 Self::ENCODED_LEN,
10688 __tmp.remaining(),
10689 )
10690 }
10691 __tmp.put_u64_le(self.time_usec);
10692 __tmp.put_u16_le(self.array_id);
10693 for val in &self.name {
10694 __tmp.put_u8(*val);
10695 }
10696 if matches!(version, MavlinkVersion::V2) {
10697 for val in &self.data {
10698 __tmp.put_f32_le(*val);
10699 }
10700 let len = __tmp.len();
10701 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10702 } else {
10703 __tmp.len()
10704 }
10705 }
10706}
10707#[doc = "To debug something using a named 3D vector."]
10708#[doc = ""]
10709#[doc = "ID: 250"]
10710#[derive(Debug, Clone, PartialEq)]
10711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10713#[cfg_attr(feature = "ts", derive(TS))]
10714#[cfg_attr(feature = "ts", ts(export))]
10715pub struct DEBUG_VECT_DATA {
10716 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10717 pub time_usec: u64,
10718 #[doc = "x"]
10719 pub x: f32,
10720 #[doc = "y"]
10721 pub y: f32,
10722 #[doc = "z"]
10723 pub z: f32,
10724 #[doc = "Name"]
10725 #[cfg_attr(feature = "ts", ts(type = "string"))]
10726 pub name: CharArray<10>,
10727}
10728impl DEBUG_VECT_DATA {
10729 pub const ENCODED_LEN: usize = 30usize;
10730 pub const DEFAULT: Self = Self {
10731 time_usec: 0_u64,
10732 x: 0.0_f32,
10733 y: 0.0_f32,
10734 z: 0.0_f32,
10735 name: CharArray::new([0_u8; 10usize]),
10736 };
10737 #[cfg(feature = "arbitrary")]
10738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10739 use arbitrary::{Arbitrary, Unstructured};
10740 let mut buf = [0u8; 1024];
10741 rng.fill_bytes(&mut buf);
10742 let mut unstructured = Unstructured::new(&buf);
10743 Self::arbitrary(&mut unstructured).unwrap_or_default()
10744 }
10745}
10746impl Default for DEBUG_VECT_DATA {
10747 fn default() -> Self {
10748 Self::DEFAULT.clone()
10749 }
10750}
10751impl MessageData for DEBUG_VECT_DATA {
10752 type Message = MavMessage;
10753 const ID: u32 = 250u32;
10754 const NAME: &'static str = "DEBUG_VECT";
10755 const EXTRA_CRC: u8 = 49u8;
10756 const ENCODED_LEN: usize = 30usize;
10757 fn deser(
10758 _version: MavlinkVersion,
10759 __input: &[u8],
10760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10761 let avail_len = __input.len();
10762 let mut payload_buf = [0; Self::ENCODED_LEN];
10763 let mut buf = if avail_len < Self::ENCODED_LEN {
10764 payload_buf[0..avail_len].copy_from_slice(__input);
10765 Bytes::new(&payload_buf)
10766 } else {
10767 Bytes::new(__input)
10768 };
10769 let mut __struct = Self::default();
10770 __struct.time_usec = buf.get_u64_le();
10771 __struct.x = buf.get_f32_le();
10772 __struct.y = buf.get_f32_le();
10773 __struct.z = buf.get_f32_le();
10774 let mut tmp = [0_u8; 10usize];
10775 for v in &mut tmp {
10776 *v = buf.get_u8();
10777 }
10778 __struct.name = CharArray::new(tmp);
10779 Ok(__struct)
10780 }
10781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10782 let mut __tmp = BytesMut::new(bytes);
10783 #[allow(clippy::absurd_extreme_comparisons)]
10784 #[allow(unused_comparisons)]
10785 if __tmp.remaining() < Self::ENCODED_LEN {
10786 panic!(
10787 "buffer is too small (need {} bytes, but got {})",
10788 Self::ENCODED_LEN,
10789 __tmp.remaining(),
10790 )
10791 }
10792 __tmp.put_u64_le(self.time_usec);
10793 __tmp.put_f32_le(self.x);
10794 __tmp.put_f32_le(self.y);
10795 __tmp.put_f32_le(self.z);
10796 for val in &self.name {
10797 __tmp.put_u8(*val);
10798 }
10799 if matches!(version, MavlinkVersion::V2) {
10800 let len = __tmp.len();
10801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10802 } else {
10803 __tmp.len()
10804 }
10805 }
10806}
10807#[doc = "Distance sensor information for an onboard rangefinder."]
10808#[doc = ""]
10809#[doc = "ID: 132"]
10810#[derive(Debug, Clone, PartialEq)]
10811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10813#[cfg_attr(feature = "ts", derive(TS))]
10814#[cfg_attr(feature = "ts", ts(export))]
10815pub struct DISTANCE_SENSOR_DATA {
10816 #[doc = "Timestamp (time since system boot)."]
10817 pub time_boot_ms: u32,
10818 #[doc = "Minimum distance the sensor can measure"]
10819 pub min_distance: u16,
10820 #[doc = "Maximum distance the sensor can measure"]
10821 pub max_distance: u16,
10822 #[doc = "Current distance reading"]
10823 pub current_distance: u16,
10824 #[doc = "Type of distance sensor."]
10825 pub mavtype: MavDistanceSensor,
10826 #[doc = "Onboard ID of the sensor"]
10827 pub id: u8,
10828 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10829 pub orientation: MavSensorOrientation,
10830 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10831 pub covariance: u8,
10832 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10833 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10834 pub horizontal_fov: f32,
10835 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10836 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10837 pub vertical_fov: f32,
10838 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10839 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10840 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10841 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10842 pub quaternion: [f32; 4],
10843 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10844 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10845 pub signal_quality: u8,
10846}
10847impl DISTANCE_SENSOR_DATA {
10848 pub const ENCODED_LEN: usize = 39usize;
10849 pub const DEFAULT: Self = Self {
10850 time_boot_ms: 0_u32,
10851 min_distance: 0_u16,
10852 max_distance: 0_u16,
10853 current_distance: 0_u16,
10854 mavtype: MavDistanceSensor::DEFAULT,
10855 id: 0_u8,
10856 orientation: MavSensorOrientation::DEFAULT,
10857 covariance: 0_u8,
10858 horizontal_fov: 0.0_f32,
10859 vertical_fov: 0.0_f32,
10860 quaternion: [0.0_f32; 4usize],
10861 signal_quality: 0_u8,
10862 };
10863 #[cfg(feature = "arbitrary")]
10864 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10865 use arbitrary::{Arbitrary, Unstructured};
10866 let mut buf = [0u8; 1024];
10867 rng.fill_bytes(&mut buf);
10868 let mut unstructured = Unstructured::new(&buf);
10869 Self::arbitrary(&mut unstructured).unwrap_or_default()
10870 }
10871}
10872impl Default for DISTANCE_SENSOR_DATA {
10873 fn default() -> Self {
10874 Self::DEFAULT.clone()
10875 }
10876}
10877impl MessageData for DISTANCE_SENSOR_DATA {
10878 type Message = MavMessage;
10879 const ID: u32 = 132u32;
10880 const NAME: &'static str = "DISTANCE_SENSOR";
10881 const EXTRA_CRC: u8 = 85u8;
10882 const ENCODED_LEN: usize = 39usize;
10883 fn deser(
10884 _version: MavlinkVersion,
10885 __input: &[u8],
10886 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10887 let avail_len = __input.len();
10888 let mut payload_buf = [0; Self::ENCODED_LEN];
10889 let mut buf = if avail_len < Self::ENCODED_LEN {
10890 payload_buf[0..avail_len].copy_from_slice(__input);
10891 Bytes::new(&payload_buf)
10892 } else {
10893 Bytes::new(__input)
10894 };
10895 let mut __struct = Self::default();
10896 __struct.time_boot_ms = buf.get_u32_le();
10897 __struct.min_distance = buf.get_u16_le();
10898 __struct.max_distance = buf.get_u16_le();
10899 __struct.current_distance = buf.get_u16_le();
10900 let tmp = buf.get_u8();
10901 __struct.mavtype =
10902 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10903 enum_type: "MavDistanceSensor",
10904 value: tmp as u32,
10905 })?;
10906 __struct.id = buf.get_u8();
10907 let tmp = buf.get_u8();
10908 __struct.orientation =
10909 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10910 enum_type: "MavSensorOrientation",
10911 value: tmp as u32,
10912 })?;
10913 __struct.covariance = buf.get_u8();
10914 __struct.horizontal_fov = buf.get_f32_le();
10915 __struct.vertical_fov = buf.get_f32_le();
10916 for v in &mut __struct.quaternion {
10917 let val = buf.get_f32_le();
10918 *v = val;
10919 }
10920 __struct.signal_quality = buf.get_u8();
10921 Ok(__struct)
10922 }
10923 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10924 let mut __tmp = BytesMut::new(bytes);
10925 #[allow(clippy::absurd_extreme_comparisons)]
10926 #[allow(unused_comparisons)]
10927 if __tmp.remaining() < Self::ENCODED_LEN {
10928 panic!(
10929 "buffer is too small (need {} bytes, but got {})",
10930 Self::ENCODED_LEN,
10931 __tmp.remaining(),
10932 )
10933 }
10934 __tmp.put_u32_le(self.time_boot_ms);
10935 __tmp.put_u16_le(self.min_distance);
10936 __tmp.put_u16_le(self.max_distance);
10937 __tmp.put_u16_le(self.current_distance);
10938 __tmp.put_u8(self.mavtype as u8);
10939 __tmp.put_u8(self.id);
10940 __tmp.put_u8(self.orientation as u8);
10941 __tmp.put_u8(self.covariance);
10942 if matches!(version, MavlinkVersion::V2) {
10943 __tmp.put_f32_le(self.horizontal_fov);
10944 __tmp.put_f32_le(self.vertical_fov);
10945 for val in &self.quaternion {
10946 __tmp.put_f32_le(*val);
10947 }
10948 __tmp.put_u8(self.signal_quality);
10949 let len = __tmp.len();
10950 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10951 } else {
10952 __tmp.len()
10953 }
10954 }
10955}
10956#[doc = "EFI status output."]
10957#[doc = ""]
10958#[doc = "ID: 225"]
10959#[derive(Debug, Clone, PartialEq)]
10960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10962#[cfg_attr(feature = "ts", derive(TS))]
10963#[cfg_attr(feature = "ts", ts(export))]
10964pub struct EFI_STATUS_DATA {
10965 #[doc = "ECU index"]
10966 pub ecu_index: f32,
10967 #[doc = "RPM"]
10968 pub rpm: f32,
10969 #[doc = "Fuel consumed"]
10970 pub fuel_consumed: f32,
10971 #[doc = "Fuel flow rate"]
10972 pub fuel_flow: f32,
10973 #[doc = "Engine load"]
10974 pub engine_load: f32,
10975 #[doc = "Throttle position"]
10976 pub throttle_position: f32,
10977 #[doc = "Spark dwell time"]
10978 pub spark_dwell_time: f32,
10979 #[doc = "Barometric pressure"]
10980 pub barometric_pressure: f32,
10981 #[doc = "Intake manifold pressure("]
10982 pub intake_manifold_pressure: f32,
10983 #[doc = "Intake manifold temperature"]
10984 pub intake_manifold_temperature: f32,
10985 #[doc = "Cylinder head temperature"]
10986 pub cylinder_head_temperature: f32,
10987 #[doc = "Ignition timing (Crank angle degrees)"]
10988 pub ignition_timing: f32,
10989 #[doc = "Injection time"]
10990 pub injection_time: f32,
10991 #[doc = "Exhaust gas temperature"]
10992 pub exhaust_gas_temperature: f32,
10993 #[doc = "Output throttle"]
10994 pub throttle_out: f32,
10995 #[doc = "Pressure/temperature compensation"]
10996 pub pt_compensation: f32,
10997 #[doc = "EFI health status"]
10998 pub health: u8,
10999 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
11000 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11001 pub ignition_voltage: f32,
11002 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11003 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11004 pub fuel_pressure: f32,
11005}
11006impl EFI_STATUS_DATA {
11007 pub const ENCODED_LEN: usize = 73usize;
11008 pub const DEFAULT: Self = Self {
11009 ecu_index: 0.0_f32,
11010 rpm: 0.0_f32,
11011 fuel_consumed: 0.0_f32,
11012 fuel_flow: 0.0_f32,
11013 engine_load: 0.0_f32,
11014 throttle_position: 0.0_f32,
11015 spark_dwell_time: 0.0_f32,
11016 barometric_pressure: 0.0_f32,
11017 intake_manifold_pressure: 0.0_f32,
11018 intake_manifold_temperature: 0.0_f32,
11019 cylinder_head_temperature: 0.0_f32,
11020 ignition_timing: 0.0_f32,
11021 injection_time: 0.0_f32,
11022 exhaust_gas_temperature: 0.0_f32,
11023 throttle_out: 0.0_f32,
11024 pt_compensation: 0.0_f32,
11025 health: 0_u8,
11026 ignition_voltage: 0.0_f32,
11027 fuel_pressure: 0.0_f32,
11028 };
11029 #[cfg(feature = "arbitrary")]
11030 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11031 use arbitrary::{Arbitrary, Unstructured};
11032 let mut buf = [0u8; 1024];
11033 rng.fill_bytes(&mut buf);
11034 let mut unstructured = Unstructured::new(&buf);
11035 Self::arbitrary(&mut unstructured).unwrap_or_default()
11036 }
11037}
11038impl Default for EFI_STATUS_DATA {
11039 fn default() -> Self {
11040 Self::DEFAULT.clone()
11041 }
11042}
11043impl MessageData for EFI_STATUS_DATA {
11044 type Message = MavMessage;
11045 const ID: u32 = 225u32;
11046 const NAME: &'static str = "EFI_STATUS";
11047 const EXTRA_CRC: u8 = 208u8;
11048 const ENCODED_LEN: usize = 73usize;
11049 fn deser(
11050 _version: MavlinkVersion,
11051 __input: &[u8],
11052 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11053 let avail_len = __input.len();
11054 let mut payload_buf = [0; Self::ENCODED_LEN];
11055 let mut buf = if avail_len < Self::ENCODED_LEN {
11056 payload_buf[0..avail_len].copy_from_slice(__input);
11057 Bytes::new(&payload_buf)
11058 } else {
11059 Bytes::new(__input)
11060 };
11061 let mut __struct = Self::default();
11062 __struct.ecu_index = buf.get_f32_le();
11063 __struct.rpm = buf.get_f32_le();
11064 __struct.fuel_consumed = buf.get_f32_le();
11065 __struct.fuel_flow = buf.get_f32_le();
11066 __struct.engine_load = buf.get_f32_le();
11067 __struct.throttle_position = buf.get_f32_le();
11068 __struct.spark_dwell_time = buf.get_f32_le();
11069 __struct.barometric_pressure = buf.get_f32_le();
11070 __struct.intake_manifold_pressure = buf.get_f32_le();
11071 __struct.intake_manifold_temperature = buf.get_f32_le();
11072 __struct.cylinder_head_temperature = buf.get_f32_le();
11073 __struct.ignition_timing = buf.get_f32_le();
11074 __struct.injection_time = buf.get_f32_le();
11075 __struct.exhaust_gas_temperature = buf.get_f32_le();
11076 __struct.throttle_out = buf.get_f32_le();
11077 __struct.pt_compensation = buf.get_f32_le();
11078 __struct.health = buf.get_u8();
11079 __struct.ignition_voltage = buf.get_f32_le();
11080 __struct.fuel_pressure = buf.get_f32_le();
11081 Ok(__struct)
11082 }
11083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11084 let mut __tmp = BytesMut::new(bytes);
11085 #[allow(clippy::absurd_extreme_comparisons)]
11086 #[allow(unused_comparisons)]
11087 if __tmp.remaining() < Self::ENCODED_LEN {
11088 panic!(
11089 "buffer is too small (need {} bytes, but got {})",
11090 Self::ENCODED_LEN,
11091 __tmp.remaining(),
11092 )
11093 }
11094 __tmp.put_f32_le(self.ecu_index);
11095 __tmp.put_f32_le(self.rpm);
11096 __tmp.put_f32_le(self.fuel_consumed);
11097 __tmp.put_f32_le(self.fuel_flow);
11098 __tmp.put_f32_le(self.engine_load);
11099 __tmp.put_f32_le(self.throttle_position);
11100 __tmp.put_f32_le(self.spark_dwell_time);
11101 __tmp.put_f32_le(self.barometric_pressure);
11102 __tmp.put_f32_le(self.intake_manifold_pressure);
11103 __tmp.put_f32_le(self.intake_manifold_temperature);
11104 __tmp.put_f32_le(self.cylinder_head_temperature);
11105 __tmp.put_f32_le(self.ignition_timing);
11106 __tmp.put_f32_le(self.injection_time);
11107 __tmp.put_f32_le(self.exhaust_gas_temperature);
11108 __tmp.put_f32_le(self.throttle_out);
11109 __tmp.put_f32_le(self.pt_compensation);
11110 __tmp.put_u8(self.health);
11111 if matches!(version, MavlinkVersion::V2) {
11112 __tmp.put_f32_le(self.ignition_voltage);
11113 __tmp.put_f32_le(self.fuel_pressure);
11114 let len = __tmp.len();
11115 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11116 } else {
11117 __tmp.len()
11118 }
11119 }
11120}
11121#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11122#[doc = ""]
11123#[doc = "ID: 131"]
11124#[derive(Debug, Clone, PartialEq)]
11125#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11126#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11127#[cfg_attr(feature = "ts", derive(TS))]
11128#[cfg_attr(feature = "ts", ts(export))]
11129pub struct ENCAPSULATED_DATA_DATA {
11130 #[doc = "sequence number (starting with 0 on every transmission)"]
11131 pub seqnr: u16,
11132 #[doc = "image data bytes"]
11133 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11134 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11135 pub data: [u8; 253],
11136}
11137impl ENCAPSULATED_DATA_DATA {
11138 pub const ENCODED_LEN: usize = 255usize;
11139 pub const DEFAULT: Self = Self {
11140 seqnr: 0_u16,
11141 data: [0_u8; 253usize],
11142 };
11143 #[cfg(feature = "arbitrary")]
11144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11145 use arbitrary::{Arbitrary, Unstructured};
11146 let mut buf = [0u8; 1024];
11147 rng.fill_bytes(&mut buf);
11148 let mut unstructured = Unstructured::new(&buf);
11149 Self::arbitrary(&mut unstructured).unwrap_or_default()
11150 }
11151}
11152impl Default for ENCAPSULATED_DATA_DATA {
11153 fn default() -> Self {
11154 Self::DEFAULT.clone()
11155 }
11156}
11157impl MessageData for ENCAPSULATED_DATA_DATA {
11158 type Message = MavMessage;
11159 const ID: u32 = 131u32;
11160 const NAME: &'static str = "ENCAPSULATED_DATA";
11161 const EXTRA_CRC: u8 = 223u8;
11162 const ENCODED_LEN: usize = 255usize;
11163 fn deser(
11164 _version: MavlinkVersion,
11165 __input: &[u8],
11166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11167 let avail_len = __input.len();
11168 let mut payload_buf = [0; Self::ENCODED_LEN];
11169 let mut buf = if avail_len < Self::ENCODED_LEN {
11170 payload_buf[0..avail_len].copy_from_slice(__input);
11171 Bytes::new(&payload_buf)
11172 } else {
11173 Bytes::new(__input)
11174 };
11175 let mut __struct = Self::default();
11176 __struct.seqnr = buf.get_u16_le();
11177 for v in &mut __struct.data {
11178 let val = buf.get_u8();
11179 *v = val;
11180 }
11181 Ok(__struct)
11182 }
11183 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11184 let mut __tmp = BytesMut::new(bytes);
11185 #[allow(clippy::absurd_extreme_comparisons)]
11186 #[allow(unused_comparisons)]
11187 if __tmp.remaining() < Self::ENCODED_LEN {
11188 panic!(
11189 "buffer is too small (need {} bytes, but got {})",
11190 Self::ENCODED_LEN,
11191 __tmp.remaining(),
11192 )
11193 }
11194 __tmp.put_u16_le(self.seqnr);
11195 for val in &self.data {
11196 __tmp.put_u8(*val);
11197 }
11198 if matches!(version, MavlinkVersion::V2) {
11199 let len = __tmp.len();
11200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11201 } else {
11202 __tmp.len()
11203 }
11204 }
11205}
11206#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11207#[doc = ""]
11208#[doc = "ID: 290"]
11209#[derive(Debug, Clone, PartialEq)]
11210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11211#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11212#[cfg_attr(feature = "ts", derive(TS))]
11213#[cfg_attr(feature = "ts", ts(export))]
11214pub struct ESC_INFO_DATA {
11215 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11216 pub time_usec: u64,
11217 #[doc = "Number of reported errors by each ESC since boot."]
11218 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11219 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11220 pub error_count: [u32; 4],
11221 #[doc = "Counter of data packets received."]
11222 pub counter: u16,
11223 #[doc = "Bitmap of ESC failure flags."]
11224 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11225 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11226 pub failure_flags: [u16; 4],
11227 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11228 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11229 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11230 pub temperature: [i16; 4],
11231 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11232 pub index: u8,
11233 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11234 pub count: u8,
11235 #[doc = "Connection type protocol for all ESC."]
11236 pub connection_type: EscConnectionType,
11237 #[doc = "Information regarding online/offline status of each ESC."]
11238 pub info: u8,
11239}
11240impl ESC_INFO_DATA {
11241 pub const ENCODED_LEN: usize = 46usize;
11242 pub const DEFAULT: Self = Self {
11243 time_usec: 0_u64,
11244 error_count: [0_u32; 4usize],
11245 counter: 0_u16,
11246 failure_flags: [0_u16; 4usize],
11247 temperature: [0_i16; 4usize],
11248 index: 0_u8,
11249 count: 0_u8,
11250 connection_type: EscConnectionType::DEFAULT,
11251 info: 0_u8,
11252 };
11253 #[cfg(feature = "arbitrary")]
11254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11255 use arbitrary::{Arbitrary, Unstructured};
11256 let mut buf = [0u8; 1024];
11257 rng.fill_bytes(&mut buf);
11258 let mut unstructured = Unstructured::new(&buf);
11259 Self::arbitrary(&mut unstructured).unwrap_or_default()
11260 }
11261}
11262impl Default for ESC_INFO_DATA {
11263 fn default() -> Self {
11264 Self::DEFAULT.clone()
11265 }
11266}
11267impl MessageData for ESC_INFO_DATA {
11268 type Message = MavMessage;
11269 const ID: u32 = 290u32;
11270 const NAME: &'static str = "ESC_INFO";
11271 const EXTRA_CRC: u8 = 251u8;
11272 const ENCODED_LEN: usize = 46usize;
11273 fn deser(
11274 _version: MavlinkVersion,
11275 __input: &[u8],
11276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11277 let avail_len = __input.len();
11278 let mut payload_buf = [0; Self::ENCODED_LEN];
11279 let mut buf = if avail_len < Self::ENCODED_LEN {
11280 payload_buf[0..avail_len].copy_from_slice(__input);
11281 Bytes::new(&payload_buf)
11282 } else {
11283 Bytes::new(__input)
11284 };
11285 let mut __struct = Self::default();
11286 __struct.time_usec = buf.get_u64_le();
11287 for v in &mut __struct.error_count {
11288 let val = buf.get_u32_le();
11289 *v = val;
11290 }
11291 __struct.counter = buf.get_u16_le();
11292 for v in &mut __struct.failure_flags {
11293 let val = buf.get_u16_le();
11294 *v = val;
11295 }
11296 for v in &mut __struct.temperature {
11297 let val = buf.get_i16_le();
11298 *v = val;
11299 }
11300 __struct.index = buf.get_u8();
11301 __struct.count = buf.get_u8();
11302 let tmp = buf.get_u8();
11303 __struct.connection_type =
11304 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11305 enum_type: "EscConnectionType",
11306 value: tmp as u32,
11307 })?;
11308 __struct.info = buf.get_u8();
11309 Ok(__struct)
11310 }
11311 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11312 let mut __tmp = BytesMut::new(bytes);
11313 #[allow(clippy::absurd_extreme_comparisons)]
11314 #[allow(unused_comparisons)]
11315 if __tmp.remaining() < Self::ENCODED_LEN {
11316 panic!(
11317 "buffer is too small (need {} bytes, but got {})",
11318 Self::ENCODED_LEN,
11319 __tmp.remaining(),
11320 )
11321 }
11322 __tmp.put_u64_le(self.time_usec);
11323 for val in &self.error_count {
11324 __tmp.put_u32_le(*val);
11325 }
11326 __tmp.put_u16_le(self.counter);
11327 for val in &self.failure_flags {
11328 __tmp.put_u16_le(*val);
11329 }
11330 for val in &self.temperature {
11331 __tmp.put_i16_le(*val);
11332 }
11333 __tmp.put_u8(self.index);
11334 __tmp.put_u8(self.count);
11335 __tmp.put_u8(self.connection_type as u8);
11336 __tmp.put_u8(self.info);
11337 if matches!(version, MavlinkVersion::V2) {
11338 let len = __tmp.len();
11339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11340 } else {
11341 __tmp.len()
11342 }
11343 }
11344}
11345#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11346#[doc = ""]
11347#[doc = "ID: 291"]
11348#[derive(Debug, Clone, PartialEq)]
11349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11351#[cfg_attr(feature = "ts", derive(TS))]
11352#[cfg_attr(feature = "ts", ts(export))]
11353pub struct ESC_STATUS_DATA {
11354 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11355 pub time_usec: u64,
11356 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11357 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11358 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11359 pub rpm: [i32; 4],
11360 #[doc = "Voltage measured from each ESC."]
11361 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11362 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11363 pub voltage: [f32; 4],
11364 #[doc = "Current measured from each ESC."]
11365 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11366 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11367 pub current: [f32; 4],
11368 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11369 pub index: u8,
11370}
11371impl ESC_STATUS_DATA {
11372 pub const ENCODED_LEN: usize = 57usize;
11373 pub const DEFAULT: Self = Self {
11374 time_usec: 0_u64,
11375 rpm: [0_i32; 4usize],
11376 voltage: [0.0_f32; 4usize],
11377 current: [0.0_f32; 4usize],
11378 index: 0_u8,
11379 };
11380 #[cfg(feature = "arbitrary")]
11381 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11382 use arbitrary::{Arbitrary, Unstructured};
11383 let mut buf = [0u8; 1024];
11384 rng.fill_bytes(&mut buf);
11385 let mut unstructured = Unstructured::new(&buf);
11386 Self::arbitrary(&mut unstructured).unwrap_or_default()
11387 }
11388}
11389impl Default for ESC_STATUS_DATA {
11390 fn default() -> Self {
11391 Self::DEFAULT.clone()
11392 }
11393}
11394impl MessageData for ESC_STATUS_DATA {
11395 type Message = MavMessage;
11396 const ID: u32 = 291u32;
11397 const NAME: &'static str = "ESC_STATUS";
11398 const EXTRA_CRC: u8 = 10u8;
11399 const ENCODED_LEN: usize = 57usize;
11400 fn deser(
11401 _version: MavlinkVersion,
11402 __input: &[u8],
11403 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11404 let avail_len = __input.len();
11405 let mut payload_buf = [0; Self::ENCODED_LEN];
11406 let mut buf = if avail_len < Self::ENCODED_LEN {
11407 payload_buf[0..avail_len].copy_from_slice(__input);
11408 Bytes::new(&payload_buf)
11409 } else {
11410 Bytes::new(__input)
11411 };
11412 let mut __struct = Self::default();
11413 __struct.time_usec = buf.get_u64_le();
11414 for v in &mut __struct.rpm {
11415 let val = buf.get_i32_le();
11416 *v = val;
11417 }
11418 for v in &mut __struct.voltage {
11419 let val = buf.get_f32_le();
11420 *v = val;
11421 }
11422 for v in &mut __struct.current {
11423 let val = buf.get_f32_le();
11424 *v = val;
11425 }
11426 __struct.index = buf.get_u8();
11427 Ok(__struct)
11428 }
11429 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11430 let mut __tmp = BytesMut::new(bytes);
11431 #[allow(clippy::absurd_extreme_comparisons)]
11432 #[allow(unused_comparisons)]
11433 if __tmp.remaining() < Self::ENCODED_LEN {
11434 panic!(
11435 "buffer is too small (need {} bytes, but got {})",
11436 Self::ENCODED_LEN,
11437 __tmp.remaining(),
11438 )
11439 }
11440 __tmp.put_u64_le(self.time_usec);
11441 for val in &self.rpm {
11442 __tmp.put_i32_le(*val);
11443 }
11444 for val in &self.voltage {
11445 __tmp.put_f32_le(*val);
11446 }
11447 for val in &self.current {
11448 __tmp.put_f32_le(*val);
11449 }
11450 __tmp.put_u8(self.index);
11451 if matches!(version, MavlinkVersion::V2) {
11452 let len = __tmp.len();
11453 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11454 } else {
11455 __tmp.len()
11456 }
11457 }
11458}
11459#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11460#[doc = ""]
11461#[doc = "ID: 230"]
11462#[derive(Debug, Clone, PartialEq)]
11463#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11464#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11465#[cfg_attr(feature = "ts", derive(TS))]
11466#[cfg_attr(feature = "ts", ts(export))]
11467pub struct ESTIMATOR_STATUS_DATA {
11468 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11469 pub time_usec: u64,
11470 #[doc = "Velocity innovation test ratio"]
11471 pub vel_ratio: f32,
11472 #[doc = "Horizontal position innovation test ratio"]
11473 pub pos_horiz_ratio: f32,
11474 #[doc = "Vertical position innovation test ratio"]
11475 pub pos_vert_ratio: f32,
11476 #[doc = "Magnetometer innovation test ratio"]
11477 pub mag_ratio: f32,
11478 #[doc = "Height above terrain innovation test ratio"]
11479 pub hagl_ratio: f32,
11480 #[doc = "True airspeed innovation test ratio"]
11481 pub tas_ratio: f32,
11482 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11483 pub pos_horiz_accuracy: f32,
11484 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11485 pub pos_vert_accuracy: f32,
11486 #[doc = "Bitmap indicating which EKF outputs are valid."]
11487 pub flags: EstimatorStatusFlags,
11488}
11489impl ESTIMATOR_STATUS_DATA {
11490 pub const ENCODED_LEN: usize = 42usize;
11491 pub const DEFAULT: Self = Self {
11492 time_usec: 0_u64,
11493 vel_ratio: 0.0_f32,
11494 pos_horiz_ratio: 0.0_f32,
11495 pos_vert_ratio: 0.0_f32,
11496 mag_ratio: 0.0_f32,
11497 hagl_ratio: 0.0_f32,
11498 tas_ratio: 0.0_f32,
11499 pos_horiz_accuracy: 0.0_f32,
11500 pos_vert_accuracy: 0.0_f32,
11501 flags: EstimatorStatusFlags::DEFAULT,
11502 };
11503 #[cfg(feature = "arbitrary")]
11504 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11505 use arbitrary::{Arbitrary, Unstructured};
11506 let mut buf = [0u8; 1024];
11507 rng.fill_bytes(&mut buf);
11508 let mut unstructured = Unstructured::new(&buf);
11509 Self::arbitrary(&mut unstructured).unwrap_or_default()
11510 }
11511}
11512impl Default for ESTIMATOR_STATUS_DATA {
11513 fn default() -> Self {
11514 Self::DEFAULT.clone()
11515 }
11516}
11517impl MessageData for ESTIMATOR_STATUS_DATA {
11518 type Message = MavMessage;
11519 const ID: u32 = 230u32;
11520 const NAME: &'static str = "ESTIMATOR_STATUS";
11521 const EXTRA_CRC: u8 = 163u8;
11522 const ENCODED_LEN: usize = 42usize;
11523 fn deser(
11524 _version: MavlinkVersion,
11525 __input: &[u8],
11526 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11527 let avail_len = __input.len();
11528 let mut payload_buf = [0; Self::ENCODED_LEN];
11529 let mut buf = if avail_len < Self::ENCODED_LEN {
11530 payload_buf[0..avail_len].copy_from_slice(__input);
11531 Bytes::new(&payload_buf)
11532 } else {
11533 Bytes::new(__input)
11534 };
11535 let mut __struct = Self::default();
11536 __struct.time_usec = buf.get_u64_le();
11537 __struct.vel_ratio = buf.get_f32_le();
11538 __struct.pos_horiz_ratio = buf.get_f32_le();
11539 __struct.pos_vert_ratio = buf.get_f32_le();
11540 __struct.mag_ratio = buf.get_f32_le();
11541 __struct.hagl_ratio = buf.get_f32_le();
11542 __struct.tas_ratio = buf.get_f32_le();
11543 __struct.pos_horiz_accuracy = buf.get_f32_le();
11544 __struct.pos_vert_accuracy = buf.get_f32_le();
11545 let tmp = buf.get_u16_le();
11546 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11547 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11548 flag_type: "EstimatorStatusFlags",
11549 value: tmp as u32,
11550 })?;
11551 Ok(__struct)
11552 }
11553 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11554 let mut __tmp = BytesMut::new(bytes);
11555 #[allow(clippy::absurd_extreme_comparisons)]
11556 #[allow(unused_comparisons)]
11557 if __tmp.remaining() < Self::ENCODED_LEN {
11558 panic!(
11559 "buffer is too small (need {} bytes, but got {})",
11560 Self::ENCODED_LEN,
11561 __tmp.remaining(),
11562 )
11563 }
11564 __tmp.put_u64_le(self.time_usec);
11565 __tmp.put_f32_le(self.vel_ratio);
11566 __tmp.put_f32_le(self.pos_horiz_ratio);
11567 __tmp.put_f32_le(self.pos_vert_ratio);
11568 __tmp.put_f32_le(self.mag_ratio);
11569 __tmp.put_f32_le(self.hagl_ratio);
11570 __tmp.put_f32_le(self.tas_ratio);
11571 __tmp.put_f32_le(self.pos_horiz_accuracy);
11572 __tmp.put_f32_le(self.pos_vert_accuracy);
11573 __tmp.put_u16_le(self.flags.bits());
11574 if matches!(version, MavlinkVersion::V2) {
11575 let len = __tmp.len();
11576 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11577 } else {
11578 __tmp.len()
11579 }
11580 }
11581}
11582#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11583#[doc = ""]
11584#[doc = "ID: 410"]
11585#[derive(Debug, Clone, PartialEq)]
11586#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11587#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11588#[cfg_attr(feature = "ts", derive(TS))]
11589#[cfg_attr(feature = "ts", ts(export))]
11590pub struct EVENT_DATA {
11591 #[doc = "Event ID (as defined in the component metadata)"]
11592 pub id: u32,
11593 #[doc = "Timestamp (time since system boot when the event happened)."]
11594 pub event_time_boot_ms: u32,
11595 #[doc = "Sequence number."]
11596 pub sequence: u16,
11597 #[doc = "Component ID"]
11598 pub destination_component: u8,
11599 #[doc = "System ID"]
11600 pub destination_system: u8,
11601 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11602 pub log_levels: u8,
11603 #[doc = "Arguments (depend on event ID)."]
11604 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11605 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11606 pub arguments: [u8; 40],
11607}
11608impl EVENT_DATA {
11609 pub const ENCODED_LEN: usize = 53usize;
11610 pub const DEFAULT: Self = Self {
11611 id: 0_u32,
11612 event_time_boot_ms: 0_u32,
11613 sequence: 0_u16,
11614 destination_component: 0_u8,
11615 destination_system: 0_u8,
11616 log_levels: 0_u8,
11617 arguments: [0_u8; 40usize],
11618 };
11619 #[cfg(feature = "arbitrary")]
11620 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11621 use arbitrary::{Arbitrary, Unstructured};
11622 let mut buf = [0u8; 1024];
11623 rng.fill_bytes(&mut buf);
11624 let mut unstructured = Unstructured::new(&buf);
11625 Self::arbitrary(&mut unstructured).unwrap_or_default()
11626 }
11627}
11628impl Default for EVENT_DATA {
11629 fn default() -> Self {
11630 Self::DEFAULT.clone()
11631 }
11632}
11633impl MessageData for EVENT_DATA {
11634 type Message = MavMessage;
11635 const ID: u32 = 410u32;
11636 const NAME: &'static str = "EVENT";
11637 const EXTRA_CRC: u8 = 160u8;
11638 const ENCODED_LEN: usize = 53usize;
11639 fn deser(
11640 _version: MavlinkVersion,
11641 __input: &[u8],
11642 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11643 let avail_len = __input.len();
11644 let mut payload_buf = [0; Self::ENCODED_LEN];
11645 let mut buf = if avail_len < Self::ENCODED_LEN {
11646 payload_buf[0..avail_len].copy_from_slice(__input);
11647 Bytes::new(&payload_buf)
11648 } else {
11649 Bytes::new(__input)
11650 };
11651 let mut __struct = Self::default();
11652 __struct.id = buf.get_u32_le();
11653 __struct.event_time_boot_ms = buf.get_u32_le();
11654 __struct.sequence = buf.get_u16_le();
11655 __struct.destination_component = buf.get_u8();
11656 __struct.destination_system = buf.get_u8();
11657 __struct.log_levels = buf.get_u8();
11658 for v in &mut __struct.arguments {
11659 let val = buf.get_u8();
11660 *v = val;
11661 }
11662 Ok(__struct)
11663 }
11664 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11665 let mut __tmp = BytesMut::new(bytes);
11666 #[allow(clippy::absurd_extreme_comparisons)]
11667 #[allow(unused_comparisons)]
11668 if __tmp.remaining() < Self::ENCODED_LEN {
11669 panic!(
11670 "buffer is too small (need {} bytes, but got {})",
11671 Self::ENCODED_LEN,
11672 __tmp.remaining(),
11673 )
11674 }
11675 __tmp.put_u32_le(self.id);
11676 __tmp.put_u32_le(self.event_time_boot_ms);
11677 __tmp.put_u16_le(self.sequence);
11678 __tmp.put_u8(self.destination_component);
11679 __tmp.put_u8(self.destination_system);
11680 __tmp.put_u8(self.log_levels);
11681 for val in &self.arguments {
11682 __tmp.put_u8(*val);
11683 }
11684 if matches!(version, MavlinkVersion::V2) {
11685 let len = __tmp.len();
11686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11687 } else {
11688 __tmp.len()
11689 }
11690 }
11691}
11692#[doc = "Provides state for additional features."]
11693#[doc = ""]
11694#[doc = "ID: 245"]
11695#[derive(Debug, Clone, PartialEq)]
11696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11698#[cfg_attr(feature = "ts", derive(TS))]
11699#[cfg_attr(feature = "ts", ts(export))]
11700pub struct EXTENDED_SYS_STATE_DATA {
11701 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11702 pub vtol_state: MavVtolState,
11703 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11704 pub landed_state: MavLandedState,
11705}
11706impl EXTENDED_SYS_STATE_DATA {
11707 pub const ENCODED_LEN: usize = 2usize;
11708 pub const DEFAULT: Self = Self {
11709 vtol_state: MavVtolState::DEFAULT,
11710 landed_state: MavLandedState::DEFAULT,
11711 };
11712 #[cfg(feature = "arbitrary")]
11713 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11714 use arbitrary::{Arbitrary, Unstructured};
11715 let mut buf = [0u8; 1024];
11716 rng.fill_bytes(&mut buf);
11717 let mut unstructured = Unstructured::new(&buf);
11718 Self::arbitrary(&mut unstructured).unwrap_or_default()
11719 }
11720}
11721impl Default for EXTENDED_SYS_STATE_DATA {
11722 fn default() -> Self {
11723 Self::DEFAULT.clone()
11724 }
11725}
11726impl MessageData for EXTENDED_SYS_STATE_DATA {
11727 type Message = MavMessage;
11728 const ID: u32 = 245u32;
11729 const NAME: &'static str = "EXTENDED_SYS_STATE";
11730 const EXTRA_CRC: u8 = 130u8;
11731 const ENCODED_LEN: usize = 2usize;
11732 fn deser(
11733 _version: MavlinkVersion,
11734 __input: &[u8],
11735 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11736 let avail_len = __input.len();
11737 let mut payload_buf = [0; Self::ENCODED_LEN];
11738 let mut buf = if avail_len < Self::ENCODED_LEN {
11739 payload_buf[0..avail_len].copy_from_slice(__input);
11740 Bytes::new(&payload_buf)
11741 } else {
11742 Bytes::new(__input)
11743 };
11744 let mut __struct = Self::default();
11745 let tmp = buf.get_u8();
11746 __struct.vtol_state =
11747 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11748 enum_type: "MavVtolState",
11749 value: tmp as u32,
11750 })?;
11751 let tmp = buf.get_u8();
11752 __struct.landed_state =
11753 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11754 enum_type: "MavLandedState",
11755 value: tmp as u32,
11756 })?;
11757 Ok(__struct)
11758 }
11759 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11760 let mut __tmp = BytesMut::new(bytes);
11761 #[allow(clippy::absurd_extreme_comparisons)]
11762 #[allow(unused_comparisons)]
11763 if __tmp.remaining() < Self::ENCODED_LEN {
11764 panic!(
11765 "buffer is too small (need {} bytes, but got {})",
11766 Self::ENCODED_LEN,
11767 __tmp.remaining(),
11768 )
11769 }
11770 __tmp.put_u8(self.vtol_state as u8);
11771 __tmp.put_u8(self.landed_state as u8);
11772 if matches!(version, MavlinkVersion::V2) {
11773 let len = __tmp.len();
11774 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11775 } else {
11776 __tmp.len()
11777 }
11778 }
11779}
11780#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11781#[doc = ""]
11782#[doc = "ID: 162"]
11783#[derive(Debug, Clone, PartialEq)]
11784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11786#[cfg_attr(feature = "ts", derive(TS))]
11787#[cfg_attr(feature = "ts", ts(export))]
11788pub struct FENCE_STATUS_DATA {
11789 #[doc = "Time (since boot) of last breach."]
11790 pub breach_time: u32,
11791 #[doc = "Number of fence breaches."]
11792 pub breach_count: u16,
11793 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11794 pub breach_status: u8,
11795 #[doc = "Last breach type."]
11796 pub breach_type: FenceBreach,
11797 #[doc = "Active action to prevent fence breach"]
11798 #[cfg_attr(feature = "serde", serde(default))]
11799 pub breach_mitigation: FenceMitigate,
11800}
11801impl FENCE_STATUS_DATA {
11802 pub const ENCODED_LEN: usize = 9usize;
11803 pub const DEFAULT: Self = Self {
11804 breach_time: 0_u32,
11805 breach_count: 0_u16,
11806 breach_status: 0_u8,
11807 breach_type: FenceBreach::DEFAULT,
11808 breach_mitigation: FenceMitigate::DEFAULT,
11809 };
11810 #[cfg(feature = "arbitrary")]
11811 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11812 use arbitrary::{Arbitrary, Unstructured};
11813 let mut buf = [0u8; 1024];
11814 rng.fill_bytes(&mut buf);
11815 let mut unstructured = Unstructured::new(&buf);
11816 Self::arbitrary(&mut unstructured).unwrap_or_default()
11817 }
11818}
11819impl Default for FENCE_STATUS_DATA {
11820 fn default() -> Self {
11821 Self::DEFAULT.clone()
11822 }
11823}
11824impl MessageData for FENCE_STATUS_DATA {
11825 type Message = MavMessage;
11826 const ID: u32 = 162u32;
11827 const NAME: &'static str = "FENCE_STATUS";
11828 const EXTRA_CRC: u8 = 189u8;
11829 const ENCODED_LEN: usize = 9usize;
11830 fn deser(
11831 _version: MavlinkVersion,
11832 __input: &[u8],
11833 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11834 let avail_len = __input.len();
11835 let mut payload_buf = [0; Self::ENCODED_LEN];
11836 let mut buf = if avail_len < Self::ENCODED_LEN {
11837 payload_buf[0..avail_len].copy_from_slice(__input);
11838 Bytes::new(&payload_buf)
11839 } else {
11840 Bytes::new(__input)
11841 };
11842 let mut __struct = Self::default();
11843 __struct.breach_time = buf.get_u32_le();
11844 __struct.breach_count = buf.get_u16_le();
11845 __struct.breach_status = buf.get_u8();
11846 let tmp = buf.get_u8();
11847 __struct.breach_type =
11848 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11849 enum_type: "FenceBreach",
11850 value: tmp as u32,
11851 })?;
11852 let tmp = buf.get_u8();
11853 __struct.breach_mitigation =
11854 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11855 enum_type: "FenceMitigate",
11856 value: tmp as u32,
11857 })?;
11858 Ok(__struct)
11859 }
11860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11861 let mut __tmp = BytesMut::new(bytes);
11862 #[allow(clippy::absurd_extreme_comparisons)]
11863 #[allow(unused_comparisons)]
11864 if __tmp.remaining() < Self::ENCODED_LEN {
11865 panic!(
11866 "buffer is too small (need {} bytes, but got {})",
11867 Self::ENCODED_LEN,
11868 __tmp.remaining(),
11869 )
11870 }
11871 __tmp.put_u32_le(self.breach_time);
11872 __tmp.put_u16_le(self.breach_count);
11873 __tmp.put_u8(self.breach_status);
11874 __tmp.put_u8(self.breach_type as u8);
11875 if matches!(version, MavlinkVersion::V2) {
11876 __tmp.put_u8(self.breach_mitigation as u8);
11877 let len = __tmp.len();
11878 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11879 } else {
11880 __tmp.len()
11881 }
11882 }
11883}
11884#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11885#[doc = ""]
11886#[doc = "ID: 110"]
11887#[derive(Debug, Clone, PartialEq)]
11888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11890#[cfg_attr(feature = "ts", derive(TS))]
11891#[cfg_attr(feature = "ts", ts(export))]
11892pub struct FILE_TRANSFER_PROTOCOL_DATA {
11893 #[doc = "Network ID (0 for broadcast)"]
11894 pub target_network: u8,
11895 #[doc = "System ID (0 for broadcast)"]
11896 pub target_system: u8,
11897 #[doc = "Component ID (0 for broadcast)"]
11898 pub target_component: u8,
11899 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11900 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11901 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11902 pub payload: [u8; 251],
11903}
11904impl FILE_TRANSFER_PROTOCOL_DATA {
11905 pub const ENCODED_LEN: usize = 254usize;
11906 pub const DEFAULT: Self = Self {
11907 target_network: 0_u8,
11908 target_system: 0_u8,
11909 target_component: 0_u8,
11910 payload: [0_u8; 251usize],
11911 };
11912 #[cfg(feature = "arbitrary")]
11913 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11914 use arbitrary::{Arbitrary, Unstructured};
11915 let mut buf = [0u8; 1024];
11916 rng.fill_bytes(&mut buf);
11917 let mut unstructured = Unstructured::new(&buf);
11918 Self::arbitrary(&mut unstructured).unwrap_or_default()
11919 }
11920}
11921impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11922 fn default() -> Self {
11923 Self::DEFAULT.clone()
11924 }
11925}
11926impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11927 type Message = MavMessage;
11928 const ID: u32 = 110u32;
11929 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11930 const EXTRA_CRC: u8 = 84u8;
11931 const ENCODED_LEN: usize = 254usize;
11932 fn deser(
11933 _version: MavlinkVersion,
11934 __input: &[u8],
11935 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11936 let avail_len = __input.len();
11937 let mut payload_buf = [0; Self::ENCODED_LEN];
11938 let mut buf = if avail_len < Self::ENCODED_LEN {
11939 payload_buf[0..avail_len].copy_from_slice(__input);
11940 Bytes::new(&payload_buf)
11941 } else {
11942 Bytes::new(__input)
11943 };
11944 let mut __struct = Self::default();
11945 __struct.target_network = buf.get_u8();
11946 __struct.target_system = buf.get_u8();
11947 __struct.target_component = buf.get_u8();
11948 for v in &mut __struct.payload {
11949 let val = buf.get_u8();
11950 *v = val;
11951 }
11952 Ok(__struct)
11953 }
11954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11955 let mut __tmp = BytesMut::new(bytes);
11956 #[allow(clippy::absurd_extreme_comparisons)]
11957 #[allow(unused_comparisons)]
11958 if __tmp.remaining() < Self::ENCODED_LEN {
11959 panic!(
11960 "buffer is too small (need {} bytes, but got {})",
11961 Self::ENCODED_LEN,
11962 __tmp.remaining(),
11963 )
11964 }
11965 __tmp.put_u8(self.target_network);
11966 __tmp.put_u8(self.target_system);
11967 __tmp.put_u8(self.target_component);
11968 for val in &self.payload {
11969 __tmp.put_u8(*val);
11970 }
11971 if matches!(version, MavlinkVersion::V2) {
11972 let len = __tmp.len();
11973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11974 } else {
11975 __tmp.len()
11976 }
11977 }
11978}
11979#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11980#[doc = ""]
11981#[doc = "ID: 264"]
11982#[derive(Debug, Clone, PartialEq)]
11983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11985#[cfg_attr(feature = "ts", derive(TS))]
11986#[cfg_attr(feature = "ts", ts(export))]
11987pub struct FLIGHT_INFORMATION_DATA {
11988 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11989 pub arming_time_utc: u64,
11990 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11991 pub takeoff_time_utc: u64,
11992 #[doc = "Flight number. Note, field is misnamed UUID."]
11993 pub flight_uuid: u64,
11994 #[doc = "Timestamp (time since system boot)."]
11995 pub time_boot_ms: u32,
11996 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11997 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11998 pub landing_time: u32,
11999}
12000impl FLIGHT_INFORMATION_DATA {
12001 pub const ENCODED_LEN: usize = 32usize;
12002 pub const DEFAULT: Self = Self {
12003 arming_time_utc: 0_u64,
12004 takeoff_time_utc: 0_u64,
12005 flight_uuid: 0_u64,
12006 time_boot_ms: 0_u32,
12007 landing_time: 0_u32,
12008 };
12009 #[cfg(feature = "arbitrary")]
12010 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12011 use arbitrary::{Arbitrary, Unstructured};
12012 let mut buf = [0u8; 1024];
12013 rng.fill_bytes(&mut buf);
12014 let mut unstructured = Unstructured::new(&buf);
12015 Self::arbitrary(&mut unstructured).unwrap_or_default()
12016 }
12017}
12018impl Default for FLIGHT_INFORMATION_DATA {
12019 fn default() -> Self {
12020 Self::DEFAULT.clone()
12021 }
12022}
12023impl MessageData for FLIGHT_INFORMATION_DATA {
12024 type Message = MavMessage;
12025 const ID: u32 = 264u32;
12026 const NAME: &'static str = "FLIGHT_INFORMATION";
12027 const EXTRA_CRC: u8 = 49u8;
12028 const ENCODED_LEN: usize = 32usize;
12029 fn deser(
12030 _version: MavlinkVersion,
12031 __input: &[u8],
12032 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12033 let avail_len = __input.len();
12034 let mut payload_buf = [0; Self::ENCODED_LEN];
12035 let mut buf = if avail_len < Self::ENCODED_LEN {
12036 payload_buf[0..avail_len].copy_from_slice(__input);
12037 Bytes::new(&payload_buf)
12038 } else {
12039 Bytes::new(__input)
12040 };
12041 let mut __struct = Self::default();
12042 __struct.arming_time_utc = buf.get_u64_le();
12043 __struct.takeoff_time_utc = buf.get_u64_le();
12044 __struct.flight_uuid = buf.get_u64_le();
12045 __struct.time_boot_ms = buf.get_u32_le();
12046 __struct.landing_time = buf.get_u32_le();
12047 Ok(__struct)
12048 }
12049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12050 let mut __tmp = BytesMut::new(bytes);
12051 #[allow(clippy::absurd_extreme_comparisons)]
12052 #[allow(unused_comparisons)]
12053 if __tmp.remaining() < Self::ENCODED_LEN {
12054 panic!(
12055 "buffer is too small (need {} bytes, but got {})",
12056 Self::ENCODED_LEN,
12057 __tmp.remaining(),
12058 )
12059 }
12060 __tmp.put_u64_le(self.arming_time_utc);
12061 __tmp.put_u64_le(self.takeoff_time_utc);
12062 __tmp.put_u64_le(self.flight_uuid);
12063 __tmp.put_u32_le(self.time_boot_ms);
12064 if matches!(version, MavlinkVersion::V2) {
12065 __tmp.put_u32_le(self.landing_time);
12066 let len = __tmp.len();
12067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12068 } else {
12069 __tmp.len()
12070 }
12071 }
12072}
12073#[doc = "Current motion information from a designated system."]
12074#[doc = ""]
12075#[doc = "ID: 144"]
12076#[derive(Debug, Clone, PartialEq)]
12077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12079#[cfg_attr(feature = "ts", derive(TS))]
12080#[cfg_attr(feature = "ts", ts(export))]
12081pub struct FOLLOW_TARGET_DATA {
12082 #[doc = "Timestamp (time since system boot)."]
12083 pub timestamp: u64,
12084 #[doc = "button states or switches of a tracker device"]
12085 pub custom_state: u64,
12086 #[doc = "Latitude (WGS84)"]
12087 pub lat: i32,
12088 #[doc = "Longitude (WGS84)"]
12089 pub lon: i32,
12090 #[doc = "Altitude (MSL)"]
12091 pub alt: f32,
12092 #[doc = "target velocity (0,0,0) for unknown"]
12093 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12094 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12095 pub vel: [f32; 3],
12096 #[doc = "linear target acceleration (0,0,0) for unknown"]
12097 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12098 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12099 pub acc: [f32; 3],
12100 #[doc = "(0 0 0 0 for unknown)"]
12101 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12102 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12103 pub attitude_q: [f32; 4],
12104 #[doc = "(0 0 0 for unknown)"]
12105 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12106 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12107 pub rates: [f32; 3],
12108 #[doc = "eph epv"]
12109 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12110 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12111 pub position_cov: [f32; 3],
12112 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12113 pub est_capabilities: u8,
12114}
12115impl FOLLOW_TARGET_DATA {
12116 pub const ENCODED_LEN: usize = 93usize;
12117 pub const DEFAULT: Self = Self {
12118 timestamp: 0_u64,
12119 custom_state: 0_u64,
12120 lat: 0_i32,
12121 lon: 0_i32,
12122 alt: 0.0_f32,
12123 vel: [0.0_f32; 3usize],
12124 acc: [0.0_f32; 3usize],
12125 attitude_q: [0.0_f32; 4usize],
12126 rates: [0.0_f32; 3usize],
12127 position_cov: [0.0_f32; 3usize],
12128 est_capabilities: 0_u8,
12129 };
12130 #[cfg(feature = "arbitrary")]
12131 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12132 use arbitrary::{Arbitrary, Unstructured};
12133 let mut buf = [0u8; 1024];
12134 rng.fill_bytes(&mut buf);
12135 let mut unstructured = Unstructured::new(&buf);
12136 Self::arbitrary(&mut unstructured).unwrap_or_default()
12137 }
12138}
12139impl Default for FOLLOW_TARGET_DATA {
12140 fn default() -> Self {
12141 Self::DEFAULT.clone()
12142 }
12143}
12144impl MessageData for FOLLOW_TARGET_DATA {
12145 type Message = MavMessage;
12146 const ID: u32 = 144u32;
12147 const NAME: &'static str = "FOLLOW_TARGET";
12148 const EXTRA_CRC: u8 = 127u8;
12149 const ENCODED_LEN: usize = 93usize;
12150 fn deser(
12151 _version: MavlinkVersion,
12152 __input: &[u8],
12153 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12154 let avail_len = __input.len();
12155 let mut payload_buf = [0; Self::ENCODED_LEN];
12156 let mut buf = if avail_len < Self::ENCODED_LEN {
12157 payload_buf[0..avail_len].copy_from_slice(__input);
12158 Bytes::new(&payload_buf)
12159 } else {
12160 Bytes::new(__input)
12161 };
12162 let mut __struct = Self::default();
12163 __struct.timestamp = buf.get_u64_le();
12164 __struct.custom_state = buf.get_u64_le();
12165 __struct.lat = buf.get_i32_le();
12166 __struct.lon = buf.get_i32_le();
12167 __struct.alt = buf.get_f32_le();
12168 for v in &mut __struct.vel {
12169 let val = buf.get_f32_le();
12170 *v = val;
12171 }
12172 for v in &mut __struct.acc {
12173 let val = buf.get_f32_le();
12174 *v = val;
12175 }
12176 for v in &mut __struct.attitude_q {
12177 let val = buf.get_f32_le();
12178 *v = val;
12179 }
12180 for v in &mut __struct.rates {
12181 let val = buf.get_f32_le();
12182 *v = val;
12183 }
12184 for v in &mut __struct.position_cov {
12185 let val = buf.get_f32_le();
12186 *v = val;
12187 }
12188 __struct.est_capabilities = buf.get_u8();
12189 Ok(__struct)
12190 }
12191 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12192 let mut __tmp = BytesMut::new(bytes);
12193 #[allow(clippy::absurd_extreme_comparisons)]
12194 #[allow(unused_comparisons)]
12195 if __tmp.remaining() < Self::ENCODED_LEN {
12196 panic!(
12197 "buffer is too small (need {} bytes, but got {})",
12198 Self::ENCODED_LEN,
12199 __tmp.remaining(),
12200 )
12201 }
12202 __tmp.put_u64_le(self.timestamp);
12203 __tmp.put_u64_le(self.custom_state);
12204 __tmp.put_i32_le(self.lat);
12205 __tmp.put_i32_le(self.lon);
12206 __tmp.put_f32_le(self.alt);
12207 for val in &self.vel {
12208 __tmp.put_f32_le(*val);
12209 }
12210 for val in &self.acc {
12211 __tmp.put_f32_le(*val);
12212 }
12213 for val in &self.attitude_q {
12214 __tmp.put_f32_le(*val);
12215 }
12216 for val in &self.rates {
12217 __tmp.put_f32_le(*val);
12218 }
12219 for val in &self.position_cov {
12220 __tmp.put_f32_le(*val);
12221 }
12222 __tmp.put_u8(self.est_capabilities);
12223 if matches!(version, MavlinkVersion::V2) {
12224 let len = __tmp.len();
12225 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12226 } else {
12227 __tmp.len()
12228 }
12229 }
12230}
12231#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12232#[doc = ""]
12233#[doc = "ID: 371"]
12234#[derive(Debug, Clone, PartialEq)]
12235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12237#[cfg_attr(feature = "ts", derive(TS))]
12238#[cfg_attr(feature = "ts", ts(export))]
12239pub struct FUEL_STATUS_DATA {
12240 #[doc = "Capacity when full. Must be provided."]
12241 pub maximum_fuel: f32,
12242 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12243 pub consumed_fuel: f32,
12244 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12245 pub remaining_fuel: f32,
12246 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12247 pub flow_rate: f32,
12248 #[doc = "Fuel temperature. NaN: field not provided."]
12249 pub temperature: f32,
12250 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12251 pub fuel_type: MavFuelType,
12252 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12253 pub id: u8,
12254 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12255 pub percent_remaining: u8,
12256}
12257impl FUEL_STATUS_DATA {
12258 pub const ENCODED_LEN: usize = 26usize;
12259 pub const DEFAULT: Self = Self {
12260 maximum_fuel: 0.0_f32,
12261 consumed_fuel: 0.0_f32,
12262 remaining_fuel: 0.0_f32,
12263 flow_rate: 0.0_f32,
12264 temperature: 0.0_f32,
12265 fuel_type: MavFuelType::DEFAULT,
12266 id: 0_u8,
12267 percent_remaining: 0_u8,
12268 };
12269 #[cfg(feature = "arbitrary")]
12270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12271 use arbitrary::{Arbitrary, Unstructured};
12272 let mut buf = [0u8; 1024];
12273 rng.fill_bytes(&mut buf);
12274 let mut unstructured = Unstructured::new(&buf);
12275 Self::arbitrary(&mut unstructured).unwrap_or_default()
12276 }
12277}
12278impl Default for FUEL_STATUS_DATA {
12279 fn default() -> Self {
12280 Self::DEFAULT.clone()
12281 }
12282}
12283impl MessageData for FUEL_STATUS_DATA {
12284 type Message = MavMessage;
12285 const ID: u32 = 371u32;
12286 const NAME: &'static str = "FUEL_STATUS";
12287 const EXTRA_CRC: u8 = 10u8;
12288 const ENCODED_LEN: usize = 26usize;
12289 fn deser(
12290 _version: MavlinkVersion,
12291 __input: &[u8],
12292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12293 let avail_len = __input.len();
12294 let mut payload_buf = [0; Self::ENCODED_LEN];
12295 let mut buf = if avail_len < Self::ENCODED_LEN {
12296 payload_buf[0..avail_len].copy_from_slice(__input);
12297 Bytes::new(&payload_buf)
12298 } else {
12299 Bytes::new(__input)
12300 };
12301 let mut __struct = Self::default();
12302 __struct.maximum_fuel = buf.get_f32_le();
12303 __struct.consumed_fuel = buf.get_f32_le();
12304 __struct.remaining_fuel = buf.get_f32_le();
12305 __struct.flow_rate = buf.get_f32_le();
12306 __struct.temperature = buf.get_f32_le();
12307 let tmp = buf.get_u32_le();
12308 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12309 ::mavlink_core::error::ParserError::InvalidEnum {
12310 enum_type: "MavFuelType",
12311 value: tmp as u32,
12312 },
12313 )?;
12314 __struct.id = buf.get_u8();
12315 __struct.percent_remaining = buf.get_u8();
12316 Ok(__struct)
12317 }
12318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12319 let mut __tmp = BytesMut::new(bytes);
12320 #[allow(clippy::absurd_extreme_comparisons)]
12321 #[allow(unused_comparisons)]
12322 if __tmp.remaining() < Self::ENCODED_LEN {
12323 panic!(
12324 "buffer is too small (need {} bytes, but got {})",
12325 Self::ENCODED_LEN,
12326 __tmp.remaining(),
12327 )
12328 }
12329 __tmp.put_f32_le(self.maximum_fuel);
12330 __tmp.put_f32_le(self.consumed_fuel);
12331 __tmp.put_f32_le(self.remaining_fuel);
12332 __tmp.put_f32_le(self.flow_rate);
12333 __tmp.put_f32_le(self.temperature);
12334 __tmp.put_u32_le(self.fuel_type as u32);
12335 __tmp.put_u8(self.id);
12336 __tmp.put_u8(self.percent_remaining);
12337 if matches!(version, MavlinkVersion::V2) {
12338 let len = __tmp.len();
12339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12340 } else {
12341 __tmp.len()
12342 }
12343 }
12344}
12345#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12346#[doc = ""]
12347#[doc = "ID: 373"]
12348#[derive(Debug, Clone, PartialEq)]
12349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12351#[cfg_attr(feature = "ts", derive(TS))]
12352#[cfg_attr(feature = "ts", ts(export))]
12353pub struct GENERATOR_STATUS_DATA {
12354 #[doc = "Status flags."]
12355 pub status: MavGeneratorStatusFlag,
12356 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12357 pub battery_current: f32,
12358 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12359 pub load_current: f32,
12360 #[doc = "The power being generated. NaN: field not provided"]
12361 pub power_generated: f32,
12362 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12363 pub bus_voltage: f32,
12364 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12365 pub bat_current_setpoint: f32,
12366 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12367 pub runtime: u32,
12368 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12369 pub time_until_maintenance: i32,
12370 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12371 pub generator_speed: u16,
12372 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12373 pub rectifier_temperature: i16,
12374 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12375 pub generator_temperature: i16,
12376}
12377impl GENERATOR_STATUS_DATA {
12378 pub const ENCODED_LEN: usize = 42usize;
12379 pub const DEFAULT: Self = Self {
12380 status: MavGeneratorStatusFlag::DEFAULT,
12381 battery_current: 0.0_f32,
12382 load_current: 0.0_f32,
12383 power_generated: 0.0_f32,
12384 bus_voltage: 0.0_f32,
12385 bat_current_setpoint: 0.0_f32,
12386 runtime: 0_u32,
12387 time_until_maintenance: 0_i32,
12388 generator_speed: 0_u16,
12389 rectifier_temperature: 0_i16,
12390 generator_temperature: 0_i16,
12391 };
12392 #[cfg(feature = "arbitrary")]
12393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12394 use arbitrary::{Arbitrary, Unstructured};
12395 let mut buf = [0u8; 1024];
12396 rng.fill_bytes(&mut buf);
12397 let mut unstructured = Unstructured::new(&buf);
12398 Self::arbitrary(&mut unstructured).unwrap_or_default()
12399 }
12400}
12401impl Default for GENERATOR_STATUS_DATA {
12402 fn default() -> Self {
12403 Self::DEFAULT.clone()
12404 }
12405}
12406impl MessageData for GENERATOR_STATUS_DATA {
12407 type Message = MavMessage;
12408 const ID: u32 = 373u32;
12409 const NAME: &'static str = "GENERATOR_STATUS";
12410 const EXTRA_CRC: u8 = 117u8;
12411 const ENCODED_LEN: usize = 42usize;
12412 fn deser(
12413 _version: MavlinkVersion,
12414 __input: &[u8],
12415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12416 let avail_len = __input.len();
12417 let mut payload_buf = [0; Self::ENCODED_LEN];
12418 let mut buf = if avail_len < Self::ENCODED_LEN {
12419 payload_buf[0..avail_len].copy_from_slice(__input);
12420 Bytes::new(&payload_buf)
12421 } else {
12422 Bytes::new(__input)
12423 };
12424 let mut __struct = Self::default();
12425 let tmp = buf.get_u64_le();
12426 __struct.status = MavGeneratorStatusFlag::from_bits(
12427 tmp & MavGeneratorStatusFlag::all().bits(),
12428 )
12429 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12430 flag_type: "MavGeneratorStatusFlag",
12431 value: tmp as u32,
12432 })?;
12433 __struct.battery_current = buf.get_f32_le();
12434 __struct.load_current = buf.get_f32_le();
12435 __struct.power_generated = buf.get_f32_le();
12436 __struct.bus_voltage = buf.get_f32_le();
12437 __struct.bat_current_setpoint = buf.get_f32_le();
12438 __struct.runtime = buf.get_u32_le();
12439 __struct.time_until_maintenance = buf.get_i32_le();
12440 __struct.generator_speed = buf.get_u16_le();
12441 __struct.rectifier_temperature = buf.get_i16_le();
12442 __struct.generator_temperature = buf.get_i16_le();
12443 Ok(__struct)
12444 }
12445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12446 let mut __tmp = BytesMut::new(bytes);
12447 #[allow(clippy::absurd_extreme_comparisons)]
12448 #[allow(unused_comparisons)]
12449 if __tmp.remaining() < Self::ENCODED_LEN {
12450 panic!(
12451 "buffer is too small (need {} bytes, but got {})",
12452 Self::ENCODED_LEN,
12453 __tmp.remaining(),
12454 )
12455 }
12456 __tmp.put_u64_le(self.status.bits());
12457 __tmp.put_f32_le(self.battery_current);
12458 __tmp.put_f32_le(self.load_current);
12459 __tmp.put_f32_le(self.power_generated);
12460 __tmp.put_f32_le(self.bus_voltage);
12461 __tmp.put_f32_le(self.bat_current_setpoint);
12462 __tmp.put_u32_le(self.runtime);
12463 __tmp.put_i32_le(self.time_until_maintenance);
12464 __tmp.put_u16_le(self.generator_speed);
12465 __tmp.put_i16_le(self.rectifier_temperature);
12466 __tmp.put_i16_le(self.generator_temperature);
12467 if matches!(version, MavlinkVersion::V2) {
12468 let len = __tmp.len();
12469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12470 } else {
12471 __tmp.len()
12472 }
12473 }
12474}
12475#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12476#[doc = ""]
12477#[doc = "ID: 285"]
12478#[derive(Debug, Clone, PartialEq)]
12479#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12481#[cfg_attr(feature = "ts", derive(TS))]
12482#[cfg_attr(feature = "ts", ts(export))]
12483pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12484 #[doc = "Timestamp (time since system boot)."]
12485 pub time_boot_ms: u32,
12486 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12487 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12488 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12489 pub q: [f32; 4],
12490 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12491 pub angular_velocity_x: f32,
12492 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12493 pub angular_velocity_y: f32,
12494 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12495 pub angular_velocity_z: f32,
12496 #[doc = "Failure flags (0 for no failure)"]
12497 pub failure_flags: GimbalDeviceErrorFlags,
12498 #[doc = "Current gimbal flags set."]
12499 pub flags: GimbalDeviceFlags,
12500 #[doc = "System ID"]
12501 pub target_system: u8,
12502 #[doc = "Component ID"]
12503 pub target_component: u8,
12504 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12505 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12506 pub delta_yaw: f32,
12507 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12508 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12509 pub delta_yaw_velocity: f32,
12510 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12511 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12512 pub gimbal_device_id: u8,
12513}
12514impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12515 pub const ENCODED_LEN: usize = 49usize;
12516 pub const DEFAULT: Self = Self {
12517 time_boot_ms: 0_u32,
12518 q: [0.0_f32; 4usize],
12519 angular_velocity_x: 0.0_f32,
12520 angular_velocity_y: 0.0_f32,
12521 angular_velocity_z: 0.0_f32,
12522 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12523 flags: GimbalDeviceFlags::DEFAULT,
12524 target_system: 0_u8,
12525 target_component: 0_u8,
12526 delta_yaw: 0.0_f32,
12527 delta_yaw_velocity: 0.0_f32,
12528 gimbal_device_id: 0_u8,
12529 };
12530 #[cfg(feature = "arbitrary")]
12531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12532 use arbitrary::{Arbitrary, Unstructured};
12533 let mut buf = [0u8; 1024];
12534 rng.fill_bytes(&mut buf);
12535 let mut unstructured = Unstructured::new(&buf);
12536 Self::arbitrary(&mut unstructured).unwrap_or_default()
12537 }
12538}
12539impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12540 fn default() -> Self {
12541 Self::DEFAULT.clone()
12542 }
12543}
12544impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12545 type Message = MavMessage;
12546 const ID: u32 = 285u32;
12547 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12548 const EXTRA_CRC: u8 = 137u8;
12549 const ENCODED_LEN: usize = 49usize;
12550 fn deser(
12551 _version: MavlinkVersion,
12552 __input: &[u8],
12553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12554 let avail_len = __input.len();
12555 let mut payload_buf = [0; Self::ENCODED_LEN];
12556 let mut buf = if avail_len < Self::ENCODED_LEN {
12557 payload_buf[0..avail_len].copy_from_slice(__input);
12558 Bytes::new(&payload_buf)
12559 } else {
12560 Bytes::new(__input)
12561 };
12562 let mut __struct = Self::default();
12563 __struct.time_boot_ms = buf.get_u32_le();
12564 for v in &mut __struct.q {
12565 let val = buf.get_f32_le();
12566 *v = val;
12567 }
12568 __struct.angular_velocity_x = buf.get_f32_le();
12569 __struct.angular_velocity_y = buf.get_f32_le();
12570 __struct.angular_velocity_z = buf.get_f32_le();
12571 let tmp = buf.get_u32_le();
12572 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12573 tmp & GimbalDeviceErrorFlags::all().bits(),
12574 )
12575 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12576 flag_type: "GimbalDeviceErrorFlags",
12577 value: tmp as u32,
12578 })?;
12579 let tmp = buf.get_u16_le();
12580 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12581 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12582 flag_type: "GimbalDeviceFlags",
12583 value: tmp as u32,
12584 })?;
12585 __struct.target_system = buf.get_u8();
12586 __struct.target_component = buf.get_u8();
12587 __struct.delta_yaw = buf.get_f32_le();
12588 __struct.delta_yaw_velocity = buf.get_f32_le();
12589 __struct.gimbal_device_id = buf.get_u8();
12590 Ok(__struct)
12591 }
12592 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12593 let mut __tmp = BytesMut::new(bytes);
12594 #[allow(clippy::absurd_extreme_comparisons)]
12595 #[allow(unused_comparisons)]
12596 if __tmp.remaining() < Self::ENCODED_LEN {
12597 panic!(
12598 "buffer is too small (need {} bytes, but got {})",
12599 Self::ENCODED_LEN,
12600 __tmp.remaining(),
12601 )
12602 }
12603 __tmp.put_u32_le(self.time_boot_ms);
12604 for val in &self.q {
12605 __tmp.put_f32_le(*val);
12606 }
12607 __tmp.put_f32_le(self.angular_velocity_x);
12608 __tmp.put_f32_le(self.angular_velocity_y);
12609 __tmp.put_f32_le(self.angular_velocity_z);
12610 __tmp.put_u32_le(self.failure_flags.bits());
12611 __tmp.put_u16_le(self.flags.bits());
12612 __tmp.put_u8(self.target_system);
12613 __tmp.put_u8(self.target_component);
12614 if matches!(version, MavlinkVersion::V2) {
12615 __tmp.put_f32_le(self.delta_yaw);
12616 __tmp.put_f32_le(self.delta_yaw_velocity);
12617 __tmp.put_u8(self.gimbal_device_id);
12618 let len = __tmp.len();
12619 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12620 } else {
12621 __tmp.len()
12622 }
12623 }
12624}
12625#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12626#[doc = ""]
12627#[doc = "ID: 283"]
12628#[derive(Debug, Clone, PartialEq)]
12629#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12630#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12631#[cfg_attr(feature = "ts", derive(TS))]
12632#[cfg_attr(feature = "ts", ts(export))]
12633pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12634 #[doc = "UID of gimbal hardware (0 if unknown)."]
12635 pub uid: u64,
12636 #[doc = "Timestamp (time since system boot)."]
12637 pub time_boot_ms: u32,
12638 #[doc = "0xff)."]
12639 pub firmware_version: u32,
12640 #[doc = "0xff)."]
12641 pub hardware_version: u32,
12642 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12643 pub roll_min: f32,
12644 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12645 pub roll_max: f32,
12646 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12647 pub pitch_min: f32,
12648 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12649 pub pitch_max: f32,
12650 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12651 pub yaw_min: f32,
12652 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12653 pub yaw_max: f32,
12654 #[doc = "Bitmap of gimbal capability flags."]
12655 pub cap_flags: GimbalDeviceCapFlags,
12656 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12657 pub custom_cap_flags: u16,
12658 #[doc = "Name of the gimbal vendor."]
12659 #[cfg_attr(feature = "ts", ts(type = "string"))]
12660 pub vendor_name: CharArray<32>,
12661 #[doc = "Name of the gimbal model."]
12662 #[cfg_attr(feature = "ts", ts(type = "string"))]
12663 pub model_name: CharArray<32>,
12664 #[doc = "Custom name of the gimbal given to it by the user."]
12665 #[cfg_attr(feature = "ts", ts(type = "string"))]
12666 pub custom_name: CharArray<32>,
12667 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12668 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12669 pub gimbal_device_id: u8,
12670}
12671impl GIMBAL_DEVICE_INFORMATION_DATA {
12672 pub const ENCODED_LEN: usize = 145usize;
12673 pub const DEFAULT: Self = Self {
12674 uid: 0_u64,
12675 time_boot_ms: 0_u32,
12676 firmware_version: 0_u32,
12677 hardware_version: 0_u32,
12678 roll_min: 0.0_f32,
12679 roll_max: 0.0_f32,
12680 pitch_min: 0.0_f32,
12681 pitch_max: 0.0_f32,
12682 yaw_min: 0.0_f32,
12683 yaw_max: 0.0_f32,
12684 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12685 custom_cap_flags: 0_u16,
12686 vendor_name: CharArray::new([0_u8; 32usize]),
12687 model_name: CharArray::new([0_u8; 32usize]),
12688 custom_name: CharArray::new([0_u8; 32usize]),
12689 gimbal_device_id: 0_u8,
12690 };
12691 #[cfg(feature = "arbitrary")]
12692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12693 use arbitrary::{Arbitrary, Unstructured};
12694 let mut buf = [0u8; 1024];
12695 rng.fill_bytes(&mut buf);
12696 let mut unstructured = Unstructured::new(&buf);
12697 Self::arbitrary(&mut unstructured).unwrap_or_default()
12698 }
12699}
12700impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12701 fn default() -> Self {
12702 Self::DEFAULT.clone()
12703 }
12704}
12705impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12706 type Message = MavMessage;
12707 const ID: u32 = 283u32;
12708 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12709 const EXTRA_CRC: u8 = 74u8;
12710 const ENCODED_LEN: usize = 145usize;
12711 fn deser(
12712 _version: MavlinkVersion,
12713 __input: &[u8],
12714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12715 let avail_len = __input.len();
12716 let mut payload_buf = [0; Self::ENCODED_LEN];
12717 let mut buf = if avail_len < Self::ENCODED_LEN {
12718 payload_buf[0..avail_len].copy_from_slice(__input);
12719 Bytes::new(&payload_buf)
12720 } else {
12721 Bytes::new(__input)
12722 };
12723 let mut __struct = Self::default();
12724 __struct.uid = buf.get_u64_le();
12725 __struct.time_boot_ms = buf.get_u32_le();
12726 __struct.firmware_version = buf.get_u32_le();
12727 __struct.hardware_version = buf.get_u32_le();
12728 __struct.roll_min = buf.get_f32_le();
12729 __struct.roll_max = buf.get_f32_le();
12730 __struct.pitch_min = buf.get_f32_le();
12731 __struct.pitch_max = buf.get_f32_le();
12732 __struct.yaw_min = buf.get_f32_le();
12733 __struct.yaw_max = buf.get_f32_le();
12734 let tmp = buf.get_u16_le();
12735 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12736 tmp & GimbalDeviceCapFlags::all().bits(),
12737 )
12738 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12739 flag_type: "GimbalDeviceCapFlags",
12740 value: tmp as u32,
12741 })?;
12742 __struct.custom_cap_flags = buf.get_u16_le();
12743 let mut tmp = [0_u8; 32usize];
12744 for v in &mut tmp {
12745 *v = buf.get_u8();
12746 }
12747 __struct.vendor_name = CharArray::new(tmp);
12748 let mut tmp = [0_u8; 32usize];
12749 for v in &mut tmp {
12750 *v = buf.get_u8();
12751 }
12752 __struct.model_name = CharArray::new(tmp);
12753 let mut tmp = [0_u8; 32usize];
12754 for v in &mut tmp {
12755 *v = buf.get_u8();
12756 }
12757 __struct.custom_name = CharArray::new(tmp);
12758 __struct.gimbal_device_id = buf.get_u8();
12759 Ok(__struct)
12760 }
12761 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12762 let mut __tmp = BytesMut::new(bytes);
12763 #[allow(clippy::absurd_extreme_comparisons)]
12764 #[allow(unused_comparisons)]
12765 if __tmp.remaining() < Self::ENCODED_LEN {
12766 panic!(
12767 "buffer is too small (need {} bytes, but got {})",
12768 Self::ENCODED_LEN,
12769 __tmp.remaining(),
12770 )
12771 }
12772 __tmp.put_u64_le(self.uid);
12773 __tmp.put_u32_le(self.time_boot_ms);
12774 __tmp.put_u32_le(self.firmware_version);
12775 __tmp.put_u32_le(self.hardware_version);
12776 __tmp.put_f32_le(self.roll_min);
12777 __tmp.put_f32_le(self.roll_max);
12778 __tmp.put_f32_le(self.pitch_min);
12779 __tmp.put_f32_le(self.pitch_max);
12780 __tmp.put_f32_le(self.yaw_min);
12781 __tmp.put_f32_le(self.yaw_max);
12782 __tmp.put_u16_le(self.cap_flags.bits());
12783 __tmp.put_u16_le(self.custom_cap_flags);
12784 for val in &self.vendor_name {
12785 __tmp.put_u8(*val);
12786 }
12787 for val in &self.model_name {
12788 __tmp.put_u8(*val);
12789 }
12790 for val in &self.custom_name {
12791 __tmp.put_u8(*val);
12792 }
12793 if matches!(version, MavlinkVersion::V2) {
12794 __tmp.put_u8(self.gimbal_device_id);
12795 let len = __tmp.len();
12796 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12797 } else {
12798 __tmp.len()
12799 }
12800 }
12801}
12802#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12803#[doc = ""]
12804#[doc = "ID: 284"]
12805#[derive(Debug, Clone, PartialEq)]
12806#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12807#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12808#[cfg_attr(feature = "ts", derive(TS))]
12809#[cfg_attr(feature = "ts", ts(export))]
12810pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12811 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12812 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12813 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12814 pub q: [f32; 4],
12815 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12816 pub angular_velocity_x: f32,
12817 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12818 pub angular_velocity_y: f32,
12819 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12820 pub angular_velocity_z: f32,
12821 #[doc = "Low level gimbal flags."]
12822 pub flags: GimbalDeviceFlags,
12823 #[doc = "System ID"]
12824 pub target_system: u8,
12825 #[doc = "Component ID"]
12826 pub target_component: u8,
12827}
12828impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12829 pub const ENCODED_LEN: usize = 32usize;
12830 pub const DEFAULT: Self = Self {
12831 q: [0.0_f32; 4usize],
12832 angular_velocity_x: 0.0_f32,
12833 angular_velocity_y: 0.0_f32,
12834 angular_velocity_z: 0.0_f32,
12835 flags: GimbalDeviceFlags::DEFAULT,
12836 target_system: 0_u8,
12837 target_component: 0_u8,
12838 };
12839 #[cfg(feature = "arbitrary")]
12840 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12841 use arbitrary::{Arbitrary, Unstructured};
12842 let mut buf = [0u8; 1024];
12843 rng.fill_bytes(&mut buf);
12844 let mut unstructured = Unstructured::new(&buf);
12845 Self::arbitrary(&mut unstructured).unwrap_or_default()
12846 }
12847}
12848impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12849 fn default() -> Self {
12850 Self::DEFAULT.clone()
12851 }
12852}
12853impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12854 type Message = MavMessage;
12855 const ID: u32 = 284u32;
12856 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12857 const EXTRA_CRC: u8 = 99u8;
12858 const ENCODED_LEN: usize = 32usize;
12859 fn deser(
12860 _version: MavlinkVersion,
12861 __input: &[u8],
12862 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12863 let avail_len = __input.len();
12864 let mut payload_buf = [0; Self::ENCODED_LEN];
12865 let mut buf = if avail_len < Self::ENCODED_LEN {
12866 payload_buf[0..avail_len].copy_from_slice(__input);
12867 Bytes::new(&payload_buf)
12868 } else {
12869 Bytes::new(__input)
12870 };
12871 let mut __struct = Self::default();
12872 for v in &mut __struct.q {
12873 let val = buf.get_f32_le();
12874 *v = val;
12875 }
12876 __struct.angular_velocity_x = buf.get_f32_le();
12877 __struct.angular_velocity_y = buf.get_f32_le();
12878 __struct.angular_velocity_z = buf.get_f32_le();
12879 let tmp = buf.get_u16_le();
12880 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12881 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12882 flag_type: "GimbalDeviceFlags",
12883 value: tmp as u32,
12884 })?;
12885 __struct.target_system = buf.get_u8();
12886 __struct.target_component = buf.get_u8();
12887 Ok(__struct)
12888 }
12889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12890 let mut __tmp = BytesMut::new(bytes);
12891 #[allow(clippy::absurd_extreme_comparisons)]
12892 #[allow(unused_comparisons)]
12893 if __tmp.remaining() < Self::ENCODED_LEN {
12894 panic!(
12895 "buffer is too small (need {} bytes, but got {})",
12896 Self::ENCODED_LEN,
12897 __tmp.remaining(),
12898 )
12899 }
12900 for val in &self.q {
12901 __tmp.put_f32_le(*val);
12902 }
12903 __tmp.put_f32_le(self.angular_velocity_x);
12904 __tmp.put_f32_le(self.angular_velocity_y);
12905 __tmp.put_f32_le(self.angular_velocity_z);
12906 __tmp.put_u16_le(self.flags.bits());
12907 __tmp.put_u8(self.target_system);
12908 __tmp.put_u8(self.target_component);
12909 if matches!(version, MavlinkVersion::V2) {
12910 let len = __tmp.len();
12911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12912 } else {
12913 __tmp.len()
12914 }
12915 }
12916}
12917#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12918#[doc = ""]
12919#[doc = "ID: 280"]
12920#[derive(Debug, Clone, PartialEq)]
12921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12923#[cfg_attr(feature = "ts", derive(TS))]
12924#[cfg_attr(feature = "ts", ts(export))]
12925pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12926 #[doc = "Timestamp (time since system boot)."]
12927 pub time_boot_ms: u32,
12928 #[doc = "Bitmap of gimbal capability flags."]
12929 pub cap_flags: GimbalManagerCapFlags,
12930 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12931 pub roll_min: f32,
12932 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12933 pub roll_max: f32,
12934 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12935 pub pitch_min: f32,
12936 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12937 pub pitch_max: f32,
12938 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12939 pub yaw_min: f32,
12940 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12941 pub yaw_max: f32,
12942 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12943 pub gimbal_device_id: u8,
12944}
12945impl GIMBAL_MANAGER_INFORMATION_DATA {
12946 pub const ENCODED_LEN: usize = 33usize;
12947 pub const DEFAULT: Self = Self {
12948 time_boot_ms: 0_u32,
12949 cap_flags: GimbalManagerCapFlags::DEFAULT,
12950 roll_min: 0.0_f32,
12951 roll_max: 0.0_f32,
12952 pitch_min: 0.0_f32,
12953 pitch_max: 0.0_f32,
12954 yaw_min: 0.0_f32,
12955 yaw_max: 0.0_f32,
12956 gimbal_device_id: 0_u8,
12957 };
12958 #[cfg(feature = "arbitrary")]
12959 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12960 use arbitrary::{Arbitrary, Unstructured};
12961 let mut buf = [0u8; 1024];
12962 rng.fill_bytes(&mut buf);
12963 let mut unstructured = Unstructured::new(&buf);
12964 Self::arbitrary(&mut unstructured).unwrap_or_default()
12965 }
12966}
12967impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12968 fn default() -> Self {
12969 Self::DEFAULT.clone()
12970 }
12971}
12972impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12973 type Message = MavMessage;
12974 const ID: u32 = 280u32;
12975 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12976 const EXTRA_CRC: u8 = 70u8;
12977 const ENCODED_LEN: usize = 33usize;
12978 fn deser(
12979 _version: MavlinkVersion,
12980 __input: &[u8],
12981 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12982 let avail_len = __input.len();
12983 let mut payload_buf = [0; Self::ENCODED_LEN];
12984 let mut buf = if avail_len < Self::ENCODED_LEN {
12985 payload_buf[0..avail_len].copy_from_slice(__input);
12986 Bytes::new(&payload_buf)
12987 } else {
12988 Bytes::new(__input)
12989 };
12990 let mut __struct = Self::default();
12991 __struct.time_boot_ms = buf.get_u32_le();
12992 let tmp = buf.get_u32_le();
12993 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12994 tmp & GimbalManagerCapFlags::all().bits(),
12995 )
12996 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12997 flag_type: "GimbalManagerCapFlags",
12998 value: tmp as u32,
12999 })?;
13000 __struct.roll_min = buf.get_f32_le();
13001 __struct.roll_max = buf.get_f32_le();
13002 __struct.pitch_min = buf.get_f32_le();
13003 __struct.pitch_max = buf.get_f32_le();
13004 __struct.yaw_min = buf.get_f32_le();
13005 __struct.yaw_max = buf.get_f32_le();
13006 __struct.gimbal_device_id = buf.get_u8();
13007 Ok(__struct)
13008 }
13009 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13010 let mut __tmp = BytesMut::new(bytes);
13011 #[allow(clippy::absurd_extreme_comparisons)]
13012 #[allow(unused_comparisons)]
13013 if __tmp.remaining() < Self::ENCODED_LEN {
13014 panic!(
13015 "buffer is too small (need {} bytes, but got {})",
13016 Self::ENCODED_LEN,
13017 __tmp.remaining(),
13018 )
13019 }
13020 __tmp.put_u32_le(self.time_boot_ms);
13021 __tmp.put_u32_le(self.cap_flags.bits());
13022 __tmp.put_f32_le(self.roll_min);
13023 __tmp.put_f32_le(self.roll_max);
13024 __tmp.put_f32_le(self.pitch_min);
13025 __tmp.put_f32_le(self.pitch_max);
13026 __tmp.put_f32_le(self.yaw_min);
13027 __tmp.put_f32_le(self.yaw_max);
13028 __tmp.put_u8(self.gimbal_device_id);
13029 if matches!(version, MavlinkVersion::V2) {
13030 let len = __tmp.len();
13031 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13032 } else {
13033 __tmp.len()
13034 }
13035 }
13036}
13037#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13038#[doc = ""]
13039#[doc = "ID: 282"]
13040#[derive(Debug, Clone, PartialEq)]
13041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13043#[cfg_attr(feature = "ts", derive(TS))]
13044#[cfg_attr(feature = "ts", ts(export))]
13045pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13046 #[doc = "High level gimbal manager flags to use."]
13047 pub flags: GimbalManagerFlags,
13048 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13049 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13050 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13051 pub q: [f32; 4],
13052 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13053 pub angular_velocity_x: f32,
13054 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13055 pub angular_velocity_y: f32,
13056 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13057 pub angular_velocity_z: f32,
13058 #[doc = "System ID"]
13059 pub target_system: u8,
13060 #[doc = "Component ID"]
13061 pub target_component: u8,
13062 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13063 pub gimbal_device_id: u8,
13064}
13065impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13066 pub const ENCODED_LEN: usize = 35usize;
13067 pub const DEFAULT: Self = Self {
13068 flags: GimbalManagerFlags::DEFAULT,
13069 q: [0.0_f32; 4usize],
13070 angular_velocity_x: 0.0_f32,
13071 angular_velocity_y: 0.0_f32,
13072 angular_velocity_z: 0.0_f32,
13073 target_system: 0_u8,
13074 target_component: 0_u8,
13075 gimbal_device_id: 0_u8,
13076 };
13077 #[cfg(feature = "arbitrary")]
13078 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13079 use arbitrary::{Arbitrary, Unstructured};
13080 let mut buf = [0u8; 1024];
13081 rng.fill_bytes(&mut buf);
13082 let mut unstructured = Unstructured::new(&buf);
13083 Self::arbitrary(&mut unstructured).unwrap_or_default()
13084 }
13085}
13086impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13087 fn default() -> Self {
13088 Self::DEFAULT.clone()
13089 }
13090}
13091impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13092 type Message = MavMessage;
13093 const ID: u32 = 282u32;
13094 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13095 const EXTRA_CRC: u8 = 123u8;
13096 const ENCODED_LEN: usize = 35usize;
13097 fn deser(
13098 _version: MavlinkVersion,
13099 __input: &[u8],
13100 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13101 let avail_len = __input.len();
13102 let mut payload_buf = [0; Self::ENCODED_LEN];
13103 let mut buf = if avail_len < Self::ENCODED_LEN {
13104 payload_buf[0..avail_len].copy_from_slice(__input);
13105 Bytes::new(&payload_buf)
13106 } else {
13107 Bytes::new(__input)
13108 };
13109 let mut __struct = Self::default();
13110 let tmp = buf.get_u32_le();
13111 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13112 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13113 flag_type: "GimbalManagerFlags",
13114 value: tmp as u32,
13115 })?;
13116 for v in &mut __struct.q {
13117 let val = buf.get_f32_le();
13118 *v = val;
13119 }
13120 __struct.angular_velocity_x = buf.get_f32_le();
13121 __struct.angular_velocity_y = buf.get_f32_le();
13122 __struct.angular_velocity_z = buf.get_f32_le();
13123 __struct.target_system = buf.get_u8();
13124 __struct.target_component = buf.get_u8();
13125 __struct.gimbal_device_id = buf.get_u8();
13126 Ok(__struct)
13127 }
13128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13129 let mut __tmp = BytesMut::new(bytes);
13130 #[allow(clippy::absurd_extreme_comparisons)]
13131 #[allow(unused_comparisons)]
13132 if __tmp.remaining() < Self::ENCODED_LEN {
13133 panic!(
13134 "buffer is too small (need {} bytes, but got {})",
13135 Self::ENCODED_LEN,
13136 __tmp.remaining(),
13137 )
13138 }
13139 __tmp.put_u32_le(self.flags.bits());
13140 for val in &self.q {
13141 __tmp.put_f32_le(*val);
13142 }
13143 __tmp.put_f32_le(self.angular_velocity_x);
13144 __tmp.put_f32_le(self.angular_velocity_y);
13145 __tmp.put_f32_le(self.angular_velocity_z);
13146 __tmp.put_u8(self.target_system);
13147 __tmp.put_u8(self.target_component);
13148 __tmp.put_u8(self.gimbal_device_id);
13149 if matches!(version, MavlinkVersion::V2) {
13150 let len = __tmp.len();
13151 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13152 } else {
13153 __tmp.len()
13154 }
13155 }
13156}
13157#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13158#[doc = ""]
13159#[doc = "ID: 288"]
13160#[derive(Debug, Clone, PartialEq)]
13161#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13162#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13163#[cfg_attr(feature = "ts", derive(TS))]
13164#[cfg_attr(feature = "ts", ts(export))]
13165pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13166 #[doc = "High level gimbal manager flags."]
13167 pub flags: GimbalManagerFlags,
13168 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13169 pub pitch: f32,
13170 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13171 pub yaw: f32,
13172 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13173 pub pitch_rate: f32,
13174 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13175 pub yaw_rate: f32,
13176 #[doc = "System ID"]
13177 pub target_system: u8,
13178 #[doc = "Component ID"]
13179 pub target_component: u8,
13180 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13181 pub gimbal_device_id: u8,
13182}
13183impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13184 pub const ENCODED_LEN: usize = 23usize;
13185 pub const DEFAULT: Self = Self {
13186 flags: GimbalManagerFlags::DEFAULT,
13187 pitch: 0.0_f32,
13188 yaw: 0.0_f32,
13189 pitch_rate: 0.0_f32,
13190 yaw_rate: 0.0_f32,
13191 target_system: 0_u8,
13192 target_component: 0_u8,
13193 gimbal_device_id: 0_u8,
13194 };
13195 #[cfg(feature = "arbitrary")]
13196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13197 use arbitrary::{Arbitrary, Unstructured};
13198 let mut buf = [0u8; 1024];
13199 rng.fill_bytes(&mut buf);
13200 let mut unstructured = Unstructured::new(&buf);
13201 Self::arbitrary(&mut unstructured).unwrap_or_default()
13202 }
13203}
13204impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13205 fn default() -> Self {
13206 Self::DEFAULT.clone()
13207 }
13208}
13209impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13210 type Message = MavMessage;
13211 const ID: u32 = 288u32;
13212 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13213 const EXTRA_CRC: u8 = 20u8;
13214 const ENCODED_LEN: usize = 23usize;
13215 fn deser(
13216 _version: MavlinkVersion,
13217 __input: &[u8],
13218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13219 let avail_len = __input.len();
13220 let mut payload_buf = [0; Self::ENCODED_LEN];
13221 let mut buf = if avail_len < Self::ENCODED_LEN {
13222 payload_buf[0..avail_len].copy_from_slice(__input);
13223 Bytes::new(&payload_buf)
13224 } else {
13225 Bytes::new(__input)
13226 };
13227 let mut __struct = Self::default();
13228 let tmp = buf.get_u32_le();
13229 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13230 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13231 flag_type: "GimbalManagerFlags",
13232 value: tmp as u32,
13233 })?;
13234 __struct.pitch = buf.get_f32_le();
13235 __struct.yaw = buf.get_f32_le();
13236 __struct.pitch_rate = buf.get_f32_le();
13237 __struct.yaw_rate = buf.get_f32_le();
13238 __struct.target_system = buf.get_u8();
13239 __struct.target_component = buf.get_u8();
13240 __struct.gimbal_device_id = buf.get_u8();
13241 Ok(__struct)
13242 }
13243 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13244 let mut __tmp = BytesMut::new(bytes);
13245 #[allow(clippy::absurd_extreme_comparisons)]
13246 #[allow(unused_comparisons)]
13247 if __tmp.remaining() < Self::ENCODED_LEN {
13248 panic!(
13249 "buffer is too small (need {} bytes, but got {})",
13250 Self::ENCODED_LEN,
13251 __tmp.remaining(),
13252 )
13253 }
13254 __tmp.put_u32_le(self.flags.bits());
13255 __tmp.put_f32_le(self.pitch);
13256 __tmp.put_f32_le(self.yaw);
13257 __tmp.put_f32_le(self.pitch_rate);
13258 __tmp.put_f32_le(self.yaw_rate);
13259 __tmp.put_u8(self.target_system);
13260 __tmp.put_u8(self.target_component);
13261 __tmp.put_u8(self.gimbal_device_id);
13262 if matches!(version, MavlinkVersion::V2) {
13263 let len = __tmp.len();
13264 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13265 } else {
13266 __tmp.len()
13267 }
13268 }
13269}
13270#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13271#[doc = ""]
13272#[doc = "ID: 287"]
13273#[derive(Debug, Clone, PartialEq)]
13274#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13275#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13276#[cfg_attr(feature = "ts", derive(TS))]
13277#[cfg_attr(feature = "ts", ts(export))]
13278pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13279 #[doc = "High level gimbal manager flags to use."]
13280 pub flags: GimbalManagerFlags,
13281 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13282 pub pitch: f32,
13283 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13284 pub yaw: f32,
13285 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13286 pub pitch_rate: f32,
13287 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13288 pub yaw_rate: f32,
13289 #[doc = "System ID"]
13290 pub target_system: u8,
13291 #[doc = "Component ID"]
13292 pub target_component: u8,
13293 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13294 pub gimbal_device_id: u8,
13295}
13296impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13297 pub const ENCODED_LEN: usize = 23usize;
13298 pub const DEFAULT: Self = Self {
13299 flags: GimbalManagerFlags::DEFAULT,
13300 pitch: 0.0_f32,
13301 yaw: 0.0_f32,
13302 pitch_rate: 0.0_f32,
13303 yaw_rate: 0.0_f32,
13304 target_system: 0_u8,
13305 target_component: 0_u8,
13306 gimbal_device_id: 0_u8,
13307 };
13308 #[cfg(feature = "arbitrary")]
13309 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13310 use arbitrary::{Arbitrary, Unstructured};
13311 let mut buf = [0u8; 1024];
13312 rng.fill_bytes(&mut buf);
13313 let mut unstructured = Unstructured::new(&buf);
13314 Self::arbitrary(&mut unstructured).unwrap_or_default()
13315 }
13316}
13317impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13318 fn default() -> Self {
13319 Self::DEFAULT.clone()
13320 }
13321}
13322impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13323 type Message = MavMessage;
13324 const ID: u32 = 287u32;
13325 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13326 const EXTRA_CRC: u8 = 1u8;
13327 const ENCODED_LEN: usize = 23usize;
13328 fn deser(
13329 _version: MavlinkVersion,
13330 __input: &[u8],
13331 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13332 let avail_len = __input.len();
13333 let mut payload_buf = [0; Self::ENCODED_LEN];
13334 let mut buf = if avail_len < Self::ENCODED_LEN {
13335 payload_buf[0..avail_len].copy_from_slice(__input);
13336 Bytes::new(&payload_buf)
13337 } else {
13338 Bytes::new(__input)
13339 };
13340 let mut __struct = Self::default();
13341 let tmp = buf.get_u32_le();
13342 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13343 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13344 flag_type: "GimbalManagerFlags",
13345 value: tmp as u32,
13346 })?;
13347 __struct.pitch = buf.get_f32_le();
13348 __struct.yaw = buf.get_f32_le();
13349 __struct.pitch_rate = buf.get_f32_le();
13350 __struct.yaw_rate = buf.get_f32_le();
13351 __struct.target_system = buf.get_u8();
13352 __struct.target_component = buf.get_u8();
13353 __struct.gimbal_device_id = buf.get_u8();
13354 Ok(__struct)
13355 }
13356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13357 let mut __tmp = BytesMut::new(bytes);
13358 #[allow(clippy::absurd_extreme_comparisons)]
13359 #[allow(unused_comparisons)]
13360 if __tmp.remaining() < Self::ENCODED_LEN {
13361 panic!(
13362 "buffer is too small (need {} bytes, but got {})",
13363 Self::ENCODED_LEN,
13364 __tmp.remaining(),
13365 )
13366 }
13367 __tmp.put_u32_le(self.flags.bits());
13368 __tmp.put_f32_le(self.pitch);
13369 __tmp.put_f32_le(self.yaw);
13370 __tmp.put_f32_le(self.pitch_rate);
13371 __tmp.put_f32_le(self.yaw_rate);
13372 __tmp.put_u8(self.target_system);
13373 __tmp.put_u8(self.target_component);
13374 __tmp.put_u8(self.gimbal_device_id);
13375 if matches!(version, MavlinkVersion::V2) {
13376 let len = __tmp.len();
13377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13378 } else {
13379 __tmp.len()
13380 }
13381 }
13382}
13383#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13384#[doc = ""]
13385#[doc = "ID: 281"]
13386#[derive(Debug, Clone, PartialEq)]
13387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13389#[cfg_attr(feature = "ts", derive(TS))]
13390#[cfg_attr(feature = "ts", ts(export))]
13391pub struct GIMBAL_MANAGER_STATUS_DATA {
13392 #[doc = "Timestamp (time since system boot)."]
13393 pub time_boot_ms: u32,
13394 #[doc = "High level gimbal manager flags currently applied."]
13395 pub flags: GimbalManagerFlags,
13396 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13397 pub gimbal_device_id: u8,
13398 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13399 pub primary_control_sysid: u8,
13400 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13401 pub primary_control_compid: u8,
13402 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13403 pub secondary_control_sysid: u8,
13404 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13405 pub secondary_control_compid: u8,
13406}
13407impl GIMBAL_MANAGER_STATUS_DATA {
13408 pub const ENCODED_LEN: usize = 13usize;
13409 pub const DEFAULT: Self = Self {
13410 time_boot_ms: 0_u32,
13411 flags: GimbalManagerFlags::DEFAULT,
13412 gimbal_device_id: 0_u8,
13413 primary_control_sysid: 0_u8,
13414 primary_control_compid: 0_u8,
13415 secondary_control_sysid: 0_u8,
13416 secondary_control_compid: 0_u8,
13417 };
13418 #[cfg(feature = "arbitrary")]
13419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13420 use arbitrary::{Arbitrary, Unstructured};
13421 let mut buf = [0u8; 1024];
13422 rng.fill_bytes(&mut buf);
13423 let mut unstructured = Unstructured::new(&buf);
13424 Self::arbitrary(&mut unstructured).unwrap_or_default()
13425 }
13426}
13427impl Default for GIMBAL_MANAGER_STATUS_DATA {
13428 fn default() -> Self {
13429 Self::DEFAULT.clone()
13430 }
13431}
13432impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13433 type Message = MavMessage;
13434 const ID: u32 = 281u32;
13435 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13436 const EXTRA_CRC: u8 = 48u8;
13437 const ENCODED_LEN: usize = 13usize;
13438 fn deser(
13439 _version: MavlinkVersion,
13440 __input: &[u8],
13441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13442 let avail_len = __input.len();
13443 let mut payload_buf = [0; Self::ENCODED_LEN];
13444 let mut buf = if avail_len < Self::ENCODED_LEN {
13445 payload_buf[0..avail_len].copy_from_slice(__input);
13446 Bytes::new(&payload_buf)
13447 } else {
13448 Bytes::new(__input)
13449 };
13450 let mut __struct = Self::default();
13451 __struct.time_boot_ms = buf.get_u32_le();
13452 let tmp = buf.get_u32_le();
13453 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13454 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13455 flag_type: "GimbalManagerFlags",
13456 value: tmp as u32,
13457 })?;
13458 __struct.gimbal_device_id = buf.get_u8();
13459 __struct.primary_control_sysid = buf.get_u8();
13460 __struct.primary_control_compid = buf.get_u8();
13461 __struct.secondary_control_sysid = buf.get_u8();
13462 __struct.secondary_control_compid = buf.get_u8();
13463 Ok(__struct)
13464 }
13465 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13466 let mut __tmp = BytesMut::new(bytes);
13467 #[allow(clippy::absurd_extreme_comparisons)]
13468 #[allow(unused_comparisons)]
13469 if __tmp.remaining() < Self::ENCODED_LEN {
13470 panic!(
13471 "buffer is too small (need {} bytes, but got {})",
13472 Self::ENCODED_LEN,
13473 __tmp.remaining(),
13474 )
13475 }
13476 __tmp.put_u32_le(self.time_boot_ms);
13477 __tmp.put_u32_le(self.flags.bits());
13478 __tmp.put_u8(self.gimbal_device_id);
13479 __tmp.put_u8(self.primary_control_sysid);
13480 __tmp.put_u8(self.primary_control_compid);
13481 __tmp.put_u8(self.secondary_control_sysid);
13482 __tmp.put_u8(self.secondary_control_compid);
13483 if matches!(version, MavlinkVersion::V2) {
13484 let len = __tmp.len();
13485 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13486 } else {
13487 __tmp.len()
13488 }
13489 }
13490}
13491#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13492#[doc = ""]
13493#[doc = "ID: 33"]
13494#[derive(Debug, Clone, PartialEq)]
13495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13496#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13497#[cfg_attr(feature = "ts", derive(TS))]
13498#[cfg_attr(feature = "ts", ts(export))]
13499pub struct GLOBAL_POSITION_INT_DATA {
13500 #[doc = "Timestamp (time since system boot)."]
13501 pub time_boot_ms: u32,
13502 #[doc = "Latitude, expressed"]
13503 pub lat: i32,
13504 #[doc = "Longitude, expressed"]
13505 pub lon: i32,
13506 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13507 pub alt: i32,
13508 #[doc = "Altitude above home"]
13509 pub relative_alt: i32,
13510 #[doc = "Ground X Speed (Latitude, positive north)"]
13511 pub vx: i16,
13512 #[doc = "Ground Y Speed (Longitude, positive east)"]
13513 pub vy: i16,
13514 #[doc = "Ground Z Speed (Altitude, positive down)"]
13515 pub vz: i16,
13516 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13517 pub hdg: u16,
13518}
13519impl GLOBAL_POSITION_INT_DATA {
13520 pub const ENCODED_LEN: usize = 28usize;
13521 pub const DEFAULT: Self = Self {
13522 time_boot_ms: 0_u32,
13523 lat: 0_i32,
13524 lon: 0_i32,
13525 alt: 0_i32,
13526 relative_alt: 0_i32,
13527 vx: 0_i16,
13528 vy: 0_i16,
13529 vz: 0_i16,
13530 hdg: 0_u16,
13531 };
13532 #[cfg(feature = "arbitrary")]
13533 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13534 use arbitrary::{Arbitrary, Unstructured};
13535 let mut buf = [0u8; 1024];
13536 rng.fill_bytes(&mut buf);
13537 let mut unstructured = Unstructured::new(&buf);
13538 Self::arbitrary(&mut unstructured).unwrap_or_default()
13539 }
13540}
13541impl Default for GLOBAL_POSITION_INT_DATA {
13542 fn default() -> Self {
13543 Self::DEFAULT.clone()
13544 }
13545}
13546impl MessageData for GLOBAL_POSITION_INT_DATA {
13547 type Message = MavMessage;
13548 const ID: u32 = 33u32;
13549 const NAME: &'static str = "GLOBAL_POSITION_INT";
13550 const EXTRA_CRC: u8 = 104u8;
13551 const ENCODED_LEN: usize = 28usize;
13552 fn deser(
13553 _version: MavlinkVersion,
13554 __input: &[u8],
13555 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13556 let avail_len = __input.len();
13557 let mut payload_buf = [0; Self::ENCODED_LEN];
13558 let mut buf = if avail_len < Self::ENCODED_LEN {
13559 payload_buf[0..avail_len].copy_from_slice(__input);
13560 Bytes::new(&payload_buf)
13561 } else {
13562 Bytes::new(__input)
13563 };
13564 let mut __struct = Self::default();
13565 __struct.time_boot_ms = buf.get_u32_le();
13566 __struct.lat = buf.get_i32_le();
13567 __struct.lon = buf.get_i32_le();
13568 __struct.alt = buf.get_i32_le();
13569 __struct.relative_alt = buf.get_i32_le();
13570 __struct.vx = buf.get_i16_le();
13571 __struct.vy = buf.get_i16_le();
13572 __struct.vz = buf.get_i16_le();
13573 __struct.hdg = buf.get_u16_le();
13574 Ok(__struct)
13575 }
13576 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13577 let mut __tmp = BytesMut::new(bytes);
13578 #[allow(clippy::absurd_extreme_comparisons)]
13579 #[allow(unused_comparisons)]
13580 if __tmp.remaining() < Self::ENCODED_LEN {
13581 panic!(
13582 "buffer is too small (need {} bytes, but got {})",
13583 Self::ENCODED_LEN,
13584 __tmp.remaining(),
13585 )
13586 }
13587 __tmp.put_u32_le(self.time_boot_ms);
13588 __tmp.put_i32_le(self.lat);
13589 __tmp.put_i32_le(self.lon);
13590 __tmp.put_i32_le(self.alt);
13591 __tmp.put_i32_le(self.relative_alt);
13592 __tmp.put_i16_le(self.vx);
13593 __tmp.put_i16_le(self.vy);
13594 __tmp.put_i16_le(self.vz);
13595 __tmp.put_u16_le(self.hdg);
13596 if matches!(version, MavlinkVersion::V2) {
13597 let len = __tmp.len();
13598 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13599 } else {
13600 __tmp.len()
13601 }
13602 }
13603}
13604#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13605#[doc = ""]
13606#[doc = "ID: 63"]
13607#[derive(Debug, Clone, PartialEq)]
13608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13609#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13610#[cfg_attr(feature = "ts", derive(TS))]
13611#[cfg_attr(feature = "ts", ts(export))]
13612pub struct GLOBAL_POSITION_INT_COV_DATA {
13613 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13614 pub time_usec: u64,
13615 #[doc = "Latitude"]
13616 pub lat: i32,
13617 #[doc = "Longitude"]
13618 pub lon: i32,
13619 #[doc = "Altitude in meters above MSL"]
13620 pub alt: i32,
13621 #[doc = "Altitude above ground"]
13622 pub relative_alt: i32,
13623 #[doc = "Ground X Speed (Latitude)"]
13624 pub vx: f32,
13625 #[doc = "Ground Y Speed (Longitude)"]
13626 pub vy: f32,
13627 #[doc = "Ground Z Speed (Altitude)"]
13628 pub vz: f32,
13629 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13630 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13631 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13632 pub covariance: [f32; 36],
13633 #[doc = "Class id of the estimator this estimate originated from."]
13634 pub estimator_type: MavEstimatorType,
13635}
13636impl GLOBAL_POSITION_INT_COV_DATA {
13637 pub const ENCODED_LEN: usize = 181usize;
13638 pub const DEFAULT: Self = Self {
13639 time_usec: 0_u64,
13640 lat: 0_i32,
13641 lon: 0_i32,
13642 alt: 0_i32,
13643 relative_alt: 0_i32,
13644 vx: 0.0_f32,
13645 vy: 0.0_f32,
13646 vz: 0.0_f32,
13647 covariance: [0.0_f32; 36usize],
13648 estimator_type: MavEstimatorType::DEFAULT,
13649 };
13650 #[cfg(feature = "arbitrary")]
13651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13652 use arbitrary::{Arbitrary, Unstructured};
13653 let mut buf = [0u8; 1024];
13654 rng.fill_bytes(&mut buf);
13655 let mut unstructured = Unstructured::new(&buf);
13656 Self::arbitrary(&mut unstructured).unwrap_or_default()
13657 }
13658}
13659impl Default for GLOBAL_POSITION_INT_COV_DATA {
13660 fn default() -> Self {
13661 Self::DEFAULT.clone()
13662 }
13663}
13664impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13665 type Message = MavMessage;
13666 const ID: u32 = 63u32;
13667 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13668 const EXTRA_CRC: u8 = 119u8;
13669 const ENCODED_LEN: usize = 181usize;
13670 fn deser(
13671 _version: MavlinkVersion,
13672 __input: &[u8],
13673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13674 let avail_len = __input.len();
13675 let mut payload_buf = [0; Self::ENCODED_LEN];
13676 let mut buf = if avail_len < Self::ENCODED_LEN {
13677 payload_buf[0..avail_len].copy_from_slice(__input);
13678 Bytes::new(&payload_buf)
13679 } else {
13680 Bytes::new(__input)
13681 };
13682 let mut __struct = Self::default();
13683 __struct.time_usec = buf.get_u64_le();
13684 __struct.lat = buf.get_i32_le();
13685 __struct.lon = buf.get_i32_le();
13686 __struct.alt = buf.get_i32_le();
13687 __struct.relative_alt = buf.get_i32_le();
13688 __struct.vx = buf.get_f32_le();
13689 __struct.vy = buf.get_f32_le();
13690 __struct.vz = buf.get_f32_le();
13691 for v in &mut __struct.covariance {
13692 let val = buf.get_f32_le();
13693 *v = val;
13694 }
13695 let tmp = buf.get_u8();
13696 __struct.estimator_type =
13697 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13698 enum_type: "MavEstimatorType",
13699 value: tmp as u32,
13700 })?;
13701 Ok(__struct)
13702 }
13703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13704 let mut __tmp = BytesMut::new(bytes);
13705 #[allow(clippy::absurd_extreme_comparisons)]
13706 #[allow(unused_comparisons)]
13707 if __tmp.remaining() < Self::ENCODED_LEN {
13708 panic!(
13709 "buffer is too small (need {} bytes, but got {})",
13710 Self::ENCODED_LEN,
13711 __tmp.remaining(),
13712 )
13713 }
13714 __tmp.put_u64_le(self.time_usec);
13715 __tmp.put_i32_le(self.lat);
13716 __tmp.put_i32_le(self.lon);
13717 __tmp.put_i32_le(self.alt);
13718 __tmp.put_i32_le(self.relative_alt);
13719 __tmp.put_f32_le(self.vx);
13720 __tmp.put_f32_le(self.vy);
13721 __tmp.put_f32_le(self.vz);
13722 for val in &self.covariance {
13723 __tmp.put_f32_le(*val);
13724 }
13725 __tmp.put_u8(self.estimator_type as u8);
13726 if matches!(version, MavlinkVersion::V2) {
13727 let len = __tmp.len();
13728 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13729 } else {
13730 __tmp.len()
13731 }
13732 }
13733}
13734#[doc = "Global position/attitude estimate from a vision source."]
13735#[doc = ""]
13736#[doc = "ID: 101"]
13737#[derive(Debug, Clone, PartialEq)]
13738#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13739#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13740#[cfg_attr(feature = "ts", derive(TS))]
13741#[cfg_attr(feature = "ts", ts(export))]
13742pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13743 #[doc = "Timestamp (UNIX time or since system boot)"]
13744 pub usec: u64,
13745 #[doc = "Global X position"]
13746 pub x: f32,
13747 #[doc = "Global Y position"]
13748 pub y: f32,
13749 #[doc = "Global Z position"]
13750 pub z: f32,
13751 #[doc = "Roll angle"]
13752 pub roll: f32,
13753 #[doc = "Pitch angle"]
13754 pub pitch: f32,
13755 #[doc = "Yaw angle"]
13756 pub yaw: f32,
13757 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13758 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13759 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13760 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13761 pub covariance: [f32; 21],
13762 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13763 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13764 pub reset_counter: u8,
13765}
13766impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13767 pub const ENCODED_LEN: usize = 117usize;
13768 pub const DEFAULT: Self = Self {
13769 usec: 0_u64,
13770 x: 0.0_f32,
13771 y: 0.0_f32,
13772 z: 0.0_f32,
13773 roll: 0.0_f32,
13774 pitch: 0.0_f32,
13775 yaw: 0.0_f32,
13776 covariance: [0.0_f32; 21usize],
13777 reset_counter: 0_u8,
13778 };
13779 #[cfg(feature = "arbitrary")]
13780 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13781 use arbitrary::{Arbitrary, Unstructured};
13782 let mut buf = [0u8; 1024];
13783 rng.fill_bytes(&mut buf);
13784 let mut unstructured = Unstructured::new(&buf);
13785 Self::arbitrary(&mut unstructured).unwrap_or_default()
13786 }
13787}
13788impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13789 fn default() -> Self {
13790 Self::DEFAULT.clone()
13791 }
13792}
13793impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13794 type Message = MavMessage;
13795 const ID: u32 = 101u32;
13796 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13797 const EXTRA_CRC: u8 = 102u8;
13798 const ENCODED_LEN: usize = 117usize;
13799 fn deser(
13800 _version: MavlinkVersion,
13801 __input: &[u8],
13802 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13803 let avail_len = __input.len();
13804 let mut payload_buf = [0; Self::ENCODED_LEN];
13805 let mut buf = if avail_len < Self::ENCODED_LEN {
13806 payload_buf[0..avail_len].copy_from_slice(__input);
13807 Bytes::new(&payload_buf)
13808 } else {
13809 Bytes::new(__input)
13810 };
13811 let mut __struct = Self::default();
13812 __struct.usec = buf.get_u64_le();
13813 __struct.x = buf.get_f32_le();
13814 __struct.y = buf.get_f32_le();
13815 __struct.z = buf.get_f32_le();
13816 __struct.roll = buf.get_f32_le();
13817 __struct.pitch = buf.get_f32_le();
13818 __struct.yaw = buf.get_f32_le();
13819 for v in &mut __struct.covariance {
13820 let val = buf.get_f32_le();
13821 *v = val;
13822 }
13823 __struct.reset_counter = buf.get_u8();
13824 Ok(__struct)
13825 }
13826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13827 let mut __tmp = BytesMut::new(bytes);
13828 #[allow(clippy::absurd_extreme_comparisons)]
13829 #[allow(unused_comparisons)]
13830 if __tmp.remaining() < Self::ENCODED_LEN {
13831 panic!(
13832 "buffer is too small (need {} bytes, but got {})",
13833 Self::ENCODED_LEN,
13834 __tmp.remaining(),
13835 )
13836 }
13837 __tmp.put_u64_le(self.usec);
13838 __tmp.put_f32_le(self.x);
13839 __tmp.put_f32_le(self.y);
13840 __tmp.put_f32_le(self.z);
13841 __tmp.put_f32_le(self.roll);
13842 __tmp.put_f32_le(self.pitch);
13843 __tmp.put_f32_le(self.yaw);
13844 if matches!(version, MavlinkVersion::V2) {
13845 for val in &self.covariance {
13846 __tmp.put_f32_le(*val);
13847 }
13848 __tmp.put_u8(self.reset_counter);
13849 let len = __tmp.len();
13850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13851 } else {
13852 __tmp.len()
13853 }
13854 }
13855}
13856#[doc = "Second GPS data."]
13857#[doc = ""]
13858#[doc = "ID: 124"]
13859#[derive(Debug, Clone, PartialEq)]
13860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13862#[cfg_attr(feature = "ts", derive(TS))]
13863#[cfg_attr(feature = "ts", ts(export))]
13864pub struct GPS2_RAW_DATA {
13865 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13866 pub time_usec: u64,
13867 #[doc = "Latitude (WGS84)"]
13868 pub lat: i32,
13869 #[doc = "Longitude (WGS84)"]
13870 pub lon: i32,
13871 #[doc = "Altitude (MSL). Positive for up."]
13872 pub alt: i32,
13873 #[doc = "Age of DGPS info"]
13874 pub dgps_age: u32,
13875 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13876 pub eph: u16,
13877 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13878 pub epv: u16,
13879 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13880 pub vel: u16,
13881 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13882 pub cog: u16,
13883 #[doc = "GPS fix type."]
13884 pub fix_type: GpsFixType,
13885 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13886 pub satellites_visible: u8,
13887 #[doc = "Number of DGPS satellites"]
13888 pub dgps_numch: u8,
13889 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13891 pub yaw: u16,
13892 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13893 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13894 pub alt_ellipsoid: i32,
13895 #[doc = "Position uncertainty."]
13896 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13897 pub h_acc: u32,
13898 #[doc = "Altitude uncertainty."]
13899 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13900 pub v_acc: u32,
13901 #[doc = "Speed uncertainty."]
13902 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13903 pub vel_acc: u32,
13904 #[doc = "Heading / track uncertainty"]
13905 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13906 pub hdg_acc: u32,
13907}
13908impl GPS2_RAW_DATA {
13909 pub const ENCODED_LEN: usize = 57usize;
13910 pub const DEFAULT: Self = Self {
13911 time_usec: 0_u64,
13912 lat: 0_i32,
13913 lon: 0_i32,
13914 alt: 0_i32,
13915 dgps_age: 0_u32,
13916 eph: 0_u16,
13917 epv: 0_u16,
13918 vel: 0_u16,
13919 cog: 0_u16,
13920 fix_type: GpsFixType::DEFAULT,
13921 satellites_visible: 0_u8,
13922 dgps_numch: 0_u8,
13923 yaw: 0_u16,
13924 alt_ellipsoid: 0_i32,
13925 h_acc: 0_u32,
13926 v_acc: 0_u32,
13927 vel_acc: 0_u32,
13928 hdg_acc: 0_u32,
13929 };
13930 #[cfg(feature = "arbitrary")]
13931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13932 use arbitrary::{Arbitrary, Unstructured};
13933 let mut buf = [0u8; 1024];
13934 rng.fill_bytes(&mut buf);
13935 let mut unstructured = Unstructured::new(&buf);
13936 Self::arbitrary(&mut unstructured).unwrap_or_default()
13937 }
13938}
13939impl Default for GPS2_RAW_DATA {
13940 fn default() -> Self {
13941 Self::DEFAULT.clone()
13942 }
13943}
13944impl MessageData for GPS2_RAW_DATA {
13945 type Message = MavMessage;
13946 const ID: u32 = 124u32;
13947 const NAME: &'static str = "GPS2_RAW";
13948 const EXTRA_CRC: u8 = 87u8;
13949 const ENCODED_LEN: usize = 57usize;
13950 fn deser(
13951 _version: MavlinkVersion,
13952 __input: &[u8],
13953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13954 let avail_len = __input.len();
13955 let mut payload_buf = [0; Self::ENCODED_LEN];
13956 let mut buf = if avail_len < Self::ENCODED_LEN {
13957 payload_buf[0..avail_len].copy_from_slice(__input);
13958 Bytes::new(&payload_buf)
13959 } else {
13960 Bytes::new(__input)
13961 };
13962 let mut __struct = Self::default();
13963 __struct.time_usec = buf.get_u64_le();
13964 __struct.lat = buf.get_i32_le();
13965 __struct.lon = buf.get_i32_le();
13966 __struct.alt = buf.get_i32_le();
13967 __struct.dgps_age = buf.get_u32_le();
13968 __struct.eph = buf.get_u16_le();
13969 __struct.epv = buf.get_u16_le();
13970 __struct.vel = buf.get_u16_le();
13971 __struct.cog = buf.get_u16_le();
13972 let tmp = buf.get_u8();
13973 __struct.fix_type =
13974 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13975 enum_type: "GpsFixType",
13976 value: tmp as u32,
13977 })?;
13978 __struct.satellites_visible = buf.get_u8();
13979 __struct.dgps_numch = buf.get_u8();
13980 __struct.yaw = buf.get_u16_le();
13981 __struct.alt_ellipsoid = buf.get_i32_le();
13982 __struct.h_acc = buf.get_u32_le();
13983 __struct.v_acc = buf.get_u32_le();
13984 __struct.vel_acc = buf.get_u32_le();
13985 __struct.hdg_acc = buf.get_u32_le();
13986 Ok(__struct)
13987 }
13988 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13989 let mut __tmp = BytesMut::new(bytes);
13990 #[allow(clippy::absurd_extreme_comparisons)]
13991 #[allow(unused_comparisons)]
13992 if __tmp.remaining() < Self::ENCODED_LEN {
13993 panic!(
13994 "buffer is too small (need {} bytes, but got {})",
13995 Self::ENCODED_LEN,
13996 __tmp.remaining(),
13997 )
13998 }
13999 __tmp.put_u64_le(self.time_usec);
14000 __tmp.put_i32_le(self.lat);
14001 __tmp.put_i32_le(self.lon);
14002 __tmp.put_i32_le(self.alt);
14003 __tmp.put_u32_le(self.dgps_age);
14004 __tmp.put_u16_le(self.eph);
14005 __tmp.put_u16_le(self.epv);
14006 __tmp.put_u16_le(self.vel);
14007 __tmp.put_u16_le(self.cog);
14008 __tmp.put_u8(self.fix_type as u8);
14009 __tmp.put_u8(self.satellites_visible);
14010 __tmp.put_u8(self.dgps_numch);
14011 if matches!(version, MavlinkVersion::V2) {
14012 __tmp.put_u16_le(self.yaw);
14013 __tmp.put_i32_le(self.alt_ellipsoid);
14014 __tmp.put_u32_le(self.h_acc);
14015 __tmp.put_u32_le(self.v_acc);
14016 __tmp.put_u32_le(self.vel_acc);
14017 __tmp.put_u32_le(self.hdg_acc);
14018 let len = __tmp.len();
14019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14020 } else {
14021 __tmp.len()
14022 }
14023 }
14024}
14025#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14026#[doc = ""]
14027#[doc = "ID: 128"]
14028#[derive(Debug, Clone, PartialEq)]
14029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14031#[cfg_attr(feature = "ts", derive(TS))]
14032#[cfg_attr(feature = "ts", ts(export))]
14033pub struct GPS2_RTK_DATA {
14034 #[doc = "Time since boot of last baseline message received."]
14035 pub time_last_baseline_ms: u32,
14036 #[doc = "GPS Time of Week of last baseline"]
14037 pub tow: u32,
14038 #[doc = "Current baseline in ECEF x or NED north component."]
14039 pub baseline_a_mm: i32,
14040 #[doc = "Current baseline in ECEF y or NED east component."]
14041 pub baseline_b_mm: i32,
14042 #[doc = "Current baseline in ECEF z or NED down component."]
14043 pub baseline_c_mm: i32,
14044 #[doc = "Current estimate of baseline accuracy."]
14045 pub accuracy: u32,
14046 #[doc = "Current number of integer ambiguity hypotheses."]
14047 pub iar_num_hypotheses: i32,
14048 #[doc = "GPS Week Number of last baseline"]
14049 pub wn: u16,
14050 #[doc = "Identification of connected RTK receiver."]
14051 pub rtk_receiver_id: u8,
14052 #[doc = "GPS-specific health report for RTK data."]
14053 pub rtk_health: u8,
14054 #[doc = "Rate of baseline messages being received by GPS"]
14055 pub rtk_rate: u8,
14056 #[doc = "Current number of sats used for RTK calculation."]
14057 pub nsats: u8,
14058 #[doc = "Coordinate system of baseline"]
14059 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14060}
14061impl GPS2_RTK_DATA {
14062 pub const ENCODED_LEN: usize = 35usize;
14063 pub const DEFAULT: Self = Self {
14064 time_last_baseline_ms: 0_u32,
14065 tow: 0_u32,
14066 baseline_a_mm: 0_i32,
14067 baseline_b_mm: 0_i32,
14068 baseline_c_mm: 0_i32,
14069 accuracy: 0_u32,
14070 iar_num_hypotheses: 0_i32,
14071 wn: 0_u16,
14072 rtk_receiver_id: 0_u8,
14073 rtk_health: 0_u8,
14074 rtk_rate: 0_u8,
14075 nsats: 0_u8,
14076 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14077 };
14078 #[cfg(feature = "arbitrary")]
14079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14080 use arbitrary::{Arbitrary, Unstructured};
14081 let mut buf = [0u8; 1024];
14082 rng.fill_bytes(&mut buf);
14083 let mut unstructured = Unstructured::new(&buf);
14084 Self::arbitrary(&mut unstructured).unwrap_or_default()
14085 }
14086}
14087impl Default for GPS2_RTK_DATA {
14088 fn default() -> Self {
14089 Self::DEFAULT.clone()
14090 }
14091}
14092impl MessageData for GPS2_RTK_DATA {
14093 type Message = MavMessage;
14094 const ID: u32 = 128u32;
14095 const NAME: &'static str = "GPS2_RTK";
14096 const EXTRA_CRC: u8 = 226u8;
14097 const ENCODED_LEN: usize = 35usize;
14098 fn deser(
14099 _version: MavlinkVersion,
14100 __input: &[u8],
14101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14102 let avail_len = __input.len();
14103 let mut payload_buf = [0; Self::ENCODED_LEN];
14104 let mut buf = if avail_len < Self::ENCODED_LEN {
14105 payload_buf[0..avail_len].copy_from_slice(__input);
14106 Bytes::new(&payload_buf)
14107 } else {
14108 Bytes::new(__input)
14109 };
14110 let mut __struct = Self::default();
14111 __struct.time_last_baseline_ms = buf.get_u32_le();
14112 __struct.tow = buf.get_u32_le();
14113 __struct.baseline_a_mm = buf.get_i32_le();
14114 __struct.baseline_b_mm = buf.get_i32_le();
14115 __struct.baseline_c_mm = buf.get_i32_le();
14116 __struct.accuracy = buf.get_u32_le();
14117 __struct.iar_num_hypotheses = buf.get_i32_le();
14118 __struct.wn = buf.get_u16_le();
14119 __struct.rtk_receiver_id = buf.get_u8();
14120 __struct.rtk_health = buf.get_u8();
14121 __struct.rtk_rate = buf.get_u8();
14122 __struct.nsats = buf.get_u8();
14123 let tmp = buf.get_u8();
14124 __struct.baseline_coords_type =
14125 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14126 enum_type: "RtkBaselineCoordinateSystem",
14127 value: tmp as u32,
14128 })?;
14129 Ok(__struct)
14130 }
14131 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14132 let mut __tmp = BytesMut::new(bytes);
14133 #[allow(clippy::absurd_extreme_comparisons)]
14134 #[allow(unused_comparisons)]
14135 if __tmp.remaining() < Self::ENCODED_LEN {
14136 panic!(
14137 "buffer is too small (need {} bytes, but got {})",
14138 Self::ENCODED_LEN,
14139 __tmp.remaining(),
14140 )
14141 }
14142 __tmp.put_u32_le(self.time_last_baseline_ms);
14143 __tmp.put_u32_le(self.tow);
14144 __tmp.put_i32_le(self.baseline_a_mm);
14145 __tmp.put_i32_le(self.baseline_b_mm);
14146 __tmp.put_i32_le(self.baseline_c_mm);
14147 __tmp.put_u32_le(self.accuracy);
14148 __tmp.put_i32_le(self.iar_num_hypotheses);
14149 __tmp.put_u16_le(self.wn);
14150 __tmp.put_u8(self.rtk_receiver_id);
14151 __tmp.put_u8(self.rtk_health);
14152 __tmp.put_u8(self.rtk_rate);
14153 __tmp.put_u8(self.nsats);
14154 __tmp.put_u8(self.baseline_coords_type as u8);
14155 if matches!(version, MavlinkVersion::V2) {
14156 let len = __tmp.len();
14157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14158 } else {
14159 __tmp.len()
14160 }
14161 }
14162}
14163#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14164#[doc = ""]
14165#[doc = "ID: 49"]
14166#[derive(Debug, Clone, PartialEq)]
14167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14169#[cfg_attr(feature = "ts", derive(TS))]
14170#[cfg_attr(feature = "ts", ts(export))]
14171pub struct GPS_GLOBAL_ORIGIN_DATA {
14172 #[doc = "Latitude (WGS84)"]
14173 pub latitude: i32,
14174 #[doc = "Longitude (WGS84)"]
14175 pub longitude: i32,
14176 #[doc = "Altitude (MSL). Positive for up."]
14177 pub altitude: i32,
14178 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14179 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14180 pub time_usec: u64,
14181}
14182impl GPS_GLOBAL_ORIGIN_DATA {
14183 pub const ENCODED_LEN: usize = 20usize;
14184 pub const DEFAULT: Self = Self {
14185 latitude: 0_i32,
14186 longitude: 0_i32,
14187 altitude: 0_i32,
14188 time_usec: 0_u64,
14189 };
14190 #[cfg(feature = "arbitrary")]
14191 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14192 use arbitrary::{Arbitrary, Unstructured};
14193 let mut buf = [0u8; 1024];
14194 rng.fill_bytes(&mut buf);
14195 let mut unstructured = Unstructured::new(&buf);
14196 Self::arbitrary(&mut unstructured).unwrap_or_default()
14197 }
14198}
14199impl Default for GPS_GLOBAL_ORIGIN_DATA {
14200 fn default() -> Self {
14201 Self::DEFAULT.clone()
14202 }
14203}
14204impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14205 type Message = MavMessage;
14206 const ID: u32 = 49u32;
14207 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14208 const EXTRA_CRC: u8 = 39u8;
14209 const ENCODED_LEN: usize = 20usize;
14210 fn deser(
14211 _version: MavlinkVersion,
14212 __input: &[u8],
14213 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14214 let avail_len = __input.len();
14215 let mut payload_buf = [0; Self::ENCODED_LEN];
14216 let mut buf = if avail_len < Self::ENCODED_LEN {
14217 payload_buf[0..avail_len].copy_from_slice(__input);
14218 Bytes::new(&payload_buf)
14219 } else {
14220 Bytes::new(__input)
14221 };
14222 let mut __struct = Self::default();
14223 __struct.latitude = buf.get_i32_le();
14224 __struct.longitude = buf.get_i32_le();
14225 __struct.altitude = buf.get_i32_le();
14226 __struct.time_usec = buf.get_u64_le();
14227 Ok(__struct)
14228 }
14229 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14230 let mut __tmp = BytesMut::new(bytes);
14231 #[allow(clippy::absurd_extreme_comparisons)]
14232 #[allow(unused_comparisons)]
14233 if __tmp.remaining() < Self::ENCODED_LEN {
14234 panic!(
14235 "buffer is too small (need {} bytes, but got {})",
14236 Self::ENCODED_LEN,
14237 __tmp.remaining(),
14238 )
14239 }
14240 __tmp.put_i32_le(self.latitude);
14241 __tmp.put_i32_le(self.longitude);
14242 __tmp.put_i32_le(self.altitude);
14243 if matches!(version, MavlinkVersion::V2) {
14244 __tmp.put_u64_le(self.time_usec);
14245 let len = __tmp.len();
14246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14247 } else {
14248 __tmp.len()
14249 }
14250 }
14251}
14252#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14253#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14254#[doc = ""]
14255#[doc = "ID: 123"]
14256#[derive(Debug, Clone, PartialEq)]
14257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14259#[cfg_attr(feature = "ts", derive(TS))]
14260#[cfg_attr(feature = "ts", ts(export))]
14261pub struct GPS_INJECT_DATA_DATA {
14262 #[doc = "System ID"]
14263 pub target_system: u8,
14264 #[doc = "Component ID"]
14265 pub target_component: u8,
14266 #[doc = "Data length"]
14267 pub len: u8,
14268 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14269 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14270 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14271 pub data: [u8; 110],
14272}
14273impl GPS_INJECT_DATA_DATA {
14274 pub const ENCODED_LEN: usize = 113usize;
14275 pub const DEFAULT: Self = Self {
14276 target_system: 0_u8,
14277 target_component: 0_u8,
14278 len: 0_u8,
14279 data: [0_u8; 110usize],
14280 };
14281 #[cfg(feature = "arbitrary")]
14282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14283 use arbitrary::{Arbitrary, Unstructured};
14284 let mut buf = [0u8; 1024];
14285 rng.fill_bytes(&mut buf);
14286 let mut unstructured = Unstructured::new(&buf);
14287 Self::arbitrary(&mut unstructured).unwrap_or_default()
14288 }
14289}
14290impl Default for GPS_INJECT_DATA_DATA {
14291 fn default() -> Self {
14292 Self::DEFAULT.clone()
14293 }
14294}
14295impl MessageData for GPS_INJECT_DATA_DATA {
14296 type Message = MavMessage;
14297 const ID: u32 = 123u32;
14298 const NAME: &'static str = "GPS_INJECT_DATA";
14299 const EXTRA_CRC: u8 = 250u8;
14300 const ENCODED_LEN: usize = 113usize;
14301 fn deser(
14302 _version: MavlinkVersion,
14303 __input: &[u8],
14304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14305 let avail_len = __input.len();
14306 let mut payload_buf = [0; Self::ENCODED_LEN];
14307 let mut buf = if avail_len < Self::ENCODED_LEN {
14308 payload_buf[0..avail_len].copy_from_slice(__input);
14309 Bytes::new(&payload_buf)
14310 } else {
14311 Bytes::new(__input)
14312 };
14313 let mut __struct = Self::default();
14314 __struct.target_system = buf.get_u8();
14315 __struct.target_component = buf.get_u8();
14316 __struct.len = buf.get_u8();
14317 for v in &mut __struct.data {
14318 let val = buf.get_u8();
14319 *v = val;
14320 }
14321 Ok(__struct)
14322 }
14323 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14324 let mut __tmp = BytesMut::new(bytes);
14325 #[allow(clippy::absurd_extreme_comparisons)]
14326 #[allow(unused_comparisons)]
14327 if __tmp.remaining() < Self::ENCODED_LEN {
14328 panic!(
14329 "buffer is too small (need {} bytes, but got {})",
14330 Self::ENCODED_LEN,
14331 __tmp.remaining(),
14332 )
14333 }
14334 __tmp.put_u8(self.target_system);
14335 __tmp.put_u8(self.target_component);
14336 __tmp.put_u8(self.len);
14337 for val in &self.data {
14338 __tmp.put_u8(*val);
14339 }
14340 if matches!(version, MavlinkVersion::V2) {
14341 let len = __tmp.len();
14342 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14343 } else {
14344 __tmp.len()
14345 }
14346 }
14347}
14348#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14349#[doc = ""]
14350#[doc = "ID: 232"]
14351#[derive(Debug, Clone, PartialEq)]
14352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14353#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14354#[cfg_attr(feature = "ts", derive(TS))]
14355#[cfg_attr(feature = "ts", ts(export))]
14356pub struct GPS_INPUT_DATA {
14357 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14358 pub time_usec: u64,
14359 #[doc = "GPS time (from start of GPS week)"]
14360 pub time_week_ms: u32,
14361 #[doc = "Latitude (WGS84)"]
14362 pub lat: i32,
14363 #[doc = "Longitude (WGS84)"]
14364 pub lon: i32,
14365 #[doc = "Altitude (MSL). Positive for up."]
14366 pub alt: f32,
14367 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14368 pub hdop: f32,
14369 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14370 pub vdop: f32,
14371 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14372 pub vn: f32,
14373 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14374 pub ve: f32,
14375 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14376 pub vd: f32,
14377 #[doc = "GPS speed accuracy"]
14378 pub speed_accuracy: f32,
14379 #[doc = "GPS horizontal accuracy"]
14380 pub horiz_accuracy: f32,
14381 #[doc = "GPS vertical accuracy"]
14382 pub vert_accuracy: f32,
14383 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14384 pub ignore_flags: GpsInputIgnoreFlags,
14385 #[doc = "GPS week number"]
14386 pub time_week: u16,
14387 #[doc = "ID of the GPS for multiple GPS inputs"]
14388 pub gps_id: u8,
14389 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14390 pub fix_type: u8,
14391 #[doc = "Number of satellites visible."]
14392 pub satellites_visible: u8,
14393 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14394 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14395 pub yaw: u16,
14396}
14397impl GPS_INPUT_DATA {
14398 pub const ENCODED_LEN: usize = 65usize;
14399 pub const DEFAULT: Self = Self {
14400 time_usec: 0_u64,
14401 time_week_ms: 0_u32,
14402 lat: 0_i32,
14403 lon: 0_i32,
14404 alt: 0.0_f32,
14405 hdop: 0.0_f32,
14406 vdop: 0.0_f32,
14407 vn: 0.0_f32,
14408 ve: 0.0_f32,
14409 vd: 0.0_f32,
14410 speed_accuracy: 0.0_f32,
14411 horiz_accuracy: 0.0_f32,
14412 vert_accuracy: 0.0_f32,
14413 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14414 time_week: 0_u16,
14415 gps_id: 0_u8,
14416 fix_type: 0_u8,
14417 satellites_visible: 0_u8,
14418 yaw: 0_u16,
14419 };
14420 #[cfg(feature = "arbitrary")]
14421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14422 use arbitrary::{Arbitrary, Unstructured};
14423 let mut buf = [0u8; 1024];
14424 rng.fill_bytes(&mut buf);
14425 let mut unstructured = Unstructured::new(&buf);
14426 Self::arbitrary(&mut unstructured).unwrap_or_default()
14427 }
14428}
14429impl Default for GPS_INPUT_DATA {
14430 fn default() -> Self {
14431 Self::DEFAULT.clone()
14432 }
14433}
14434impl MessageData for GPS_INPUT_DATA {
14435 type Message = MavMessage;
14436 const ID: u32 = 232u32;
14437 const NAME: &'static str = "GPS_INPUT";
14438 const EXTRA_CRC: u8 = 151u8;
14439 const ENCODED_LEN: usize = 65usize;
14440 fn deser(
14441 _version: MavlinkVersion,
14442 __input: &[u8],
14443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14444 let avail_len = __input.len();
14445 let mut payload_buf = [0; Self::ENCODED_LEN];
14446 let mut buf = if avail_len < Self::ENCODED_LEN {
14447 payload_buf[0..avail_len].copy_from_slice(__input);
14448 Bytes::new(&payload_buf)
14449 } else {
14450 Bytes::new(__input)
14451 };
14452 let mut __struct = Self::default();
14453 __struct.time_usec = buf.get_u64_le();
14454 __struct.time_week_ms = buf.get_u32_le();
14455 __struct.lat = buf.get_i32_le();
14456 __struct.lon = buf.get_i32_le();
14457 __struct.alt = buf.get_f32_le();
14458 __struct.hdop = buf.get_f32_le();
14459 __struct.vdop = buf.get_f32_le();
14460 __struct.vn = buf.get_f32_le();
14461 __struct.ve = buf.get_f32_le();
14462 __struct.vd = buf.get_f32_le();
14463 __struct.speed_accuracy = buf.get_f32_le();
14464 __struct.horiz_accuracy = buf.get_f32_le();
14465 __struct.vert_accuracy = buf.get_f32_le();
14466 let tmp = buf.get_u16_le();
14467 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14468 tmp & GpsInputIgnoreFlags::all().bits(),
14469 )
14470 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14471 flag_type: "GpsInputIgnoreFlags",
14472 value: tmp as u32,
14473 })?;
14474 __struct.time_week = buf.get_u16_le();
14475 __struct.gps_id = buf.get_u8();
14476 __struct.fix_type = buf.get_u8();
14477 __struct.satellites_visible = buf.get_u8();
14478 __struct.yaw = buf.get_u16_le();
14479 Ok(__struct)
14480 }
14481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14482 let mut __tmp = BytesMut::new(bytes);
14483 #[allow(clippy::absurd_extreme_comparisons)]
14484 #[allow(unused_comparisons)]
14485 if __tmp.remaining() < Self::ENCODED_LEN {
14486 panic!(
14487 "buffer is too small (need {} bytes, but got {})",
14488 Self::ENCODED_LEN,
14489 __tmp.remaining(),
14490 )
14491 }
14492 __tmp.put_u64_le(self.time_usec);
14493 __tmp.put_u32_le(self.time_week_ms);
14494 __tmp.put_i32_le(self.lat);
14495 __tmp.put_i32_le(self.lon);
14496 __tmp.put_f32_le(self.alt);
14497 __tmp.put_f32_le(self.hdop);
14498 __tmp.put_f32_le(self.vdop);
14499 __tmp.put_f32_le(self.vn);
14500 __tmp.put_f32_le(self.ve);
14501 __tmp.put_f32_le(self.vd);
14502 __tmp.put_f32_le(self.speed_accuracy);
14503 __tmp.put_f32_le(self.horiz_accuracy);
14504 __tmp.put_f32_le(self.vert_accuracy);
14505 __tmp.put_u16_le(self.ignore_flags.bits());
14506 __tmp.put_u16_le(self.time_week);
14507 __tmp.put_u8(self.gps_id);
14508 __tmp.put_u8(self.fix_type);
14509 __tmp.put_u8(self.satellites_visible);
14510 if matches!(version, MavlinkVersion::V2) {
14511 __tmp.put_u16_le(self.yaw);
14512 let len = __tmp.len();
14513 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14514 } else {
14515 __tmp.len()
14516 }
14517 }
14518}
14519#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14520#[doc = ""]
14521#[doc = "ID: 24"]
14522#[derive(Debug, Clone, PartialEq)]
14523#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14524#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14525#[cfg_attr(feature = "ts", derive(TS))]
14526#[cfg_attr(feature = "ts", ts(export))]
14527pub struct GPS_RAW_INT_DATA {
14528 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14529 pub time_usec: u64,
14530 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14531 pub lat: i32,
14532 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14533 pub lon: i32,
14534 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14535 pub alt: i32,
14536 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14537 pub eph: u16,
14538 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14539 pub epv: u16,
14540 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14541 pub vel: u16,
14542 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14543 pub cog: u16,
14544 #[doc = "GPS fix type."]
14545 pub fix_type: GpsFixType,
14546 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14547 pub satellites_visible: u8,
14548 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14549 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14550 pub alt_ellipsoid: i32,
14551 #[doc = "Position uncertainty."]
14552 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14553 pub h_acc: u32,
14554 #[doc = "Altitude uncertainty."]
14555 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14556 pub v_acc: u32,
14557 #[doc = "Speed uncertainty."]
14558 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14559 pub vel_acc: u32,
14560 #[doc = "Heading / track uncertainty"]
14561 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14562 pub hdg_acc: u32,
14563 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14564 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14565 pub yaw: u16,
14566}
14567impl GPS_RAW_INT_DATA {
14568 pub const ENCODED_LEN: usize = 52usize;
14569 pub const DEFAULT: Self = Self {
14570 time_usec: 0_u64,
14571 lat: 0_i32,
14572 lon: 0_i32,
14573 alt: 0_i32,
14574 eph: 0_u16,
14575 epv: 0_u16,
14576 vel: 0_u16,
14577 cog: 0_u16,
14578 fix_type: GpsFixType::DEFAULT,
14579 satellites_visible: 0_u8,
14580 alt_ellipsoid: 0_i32,
14581 h_acc: 0_u32,
14582 v_acc: 0_u32,
14583 vel_acc: 0_u32,
14584 hdg_acc: 0_u32,
14585 yaw: 0_u16,
14586 };
14587 #[cfg(feature = "arbitrary")]
14588 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14589 use arbitrary::{Arbitrary, Unstructured};
14590 let mut buf = [0u8; 1024];
14591 rng.fill_bytes(&mut buf);
14592 let mut unstructured = Unstructured::new(&buf);
14593 Self::arbitrary(&mut unstructured).unwrap_or_default()
14594 }
14595}
14596impl Default for GPS_RAW_INT_DATA {
14597 fn default() -> Self {
14598 Self::DEFAULT.clone()
14599 }
14600}
14601impl MessageData for GPS_RAW_INT_DATA {
14602 type Message = MavMessage;
14603 const ID: u32 = 24u32;
14604 const NAME: &'static str = "GPS_RAW_INT";
14605 const EXTRA_CRC: u8 = 24u8;
14606 const ENCODED_LEN: usize = 52usize;
14607 fn deser(
14608 _version: MavlinkVersion,
14609 __input: &[u8],
14610 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14611 let avail_len = __input.len();
14612 let mut payload_buf = [0; Self::ENCODED_LEN];
14613 let mut buf = if avail_len < Self::ENCODED_LEN {
14614 payload_buf[0..avail_len].copy_from_slice(__input);
14615 Bytes::new(&payload_buf)
14616 } else {
14617 Bytes::new(__input)
14618 };
14619 let mut __struct = Self::default();
14620 __struct.time_usec = buf.get_u64_le();
14621 __struct.lat = buf.get_i32_le();
14622 __struct.lon = buf.get_i32_le();
14623 __struct.alt = buf.get_i32_le();
14624 __struct.eph = buf.get_u16_le();
14625 __struct.epv = buf.get_u16_le();
14626 __struct.vel = buf.get_u16_le();
14627 __struct.cog = buf.get_u16_le();
14628 let tmp = buf.get_u8();
14629 __struct.fix_type =
14630 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14631 enum_type: "GpsFixType",
14632 value: tmp as u32,
14633 })?;
14634 __struct.satellites_visible = buf.get_u8();
14635 __struct.alt_ellipsoid = buf.get_i32_le();
14636 __struct.h_acc = buf.get_u32_le();
14637 __struct.v_acc = buf.get_u32_le();
14638 __struct.vel_acc = buf.get_u32_le();
14639 __struct.hdg_acc = buf.get_u32_le();
14640 __struct.yaw = buf.get_u16_le();
14641 Ok(__struct)
14642 }
14643 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14644 let mut __tmp = BytesMut::new(bytes);
14645 #[allow(clippy::absurd_extreme_comparisons)]
14646 #[allow(unused_comparisons)]
14647 if __tmp.remaining() < Self::ENCODED_LEN {
14648 panic!(
14649 "buffer is too small (need {} bytes, but got {})",
14650 Self::ENCODED_LEN,
14651 __tmp.remaining(),
14652 )
14653 }
14654 __tmp.put_u64_le(self.time_usec);
14655 __tmp.put_i32_le(self.lat);
14656 __tmp.put_i32_le(self.lon);
14657 __tmp.put_i32_le(self.alt);
14658 __tmp.put_u16_le(self.eph);
14659 __tmp.put_u16_le(self.epv);
14660 __tmp.put_u16_le(self.vel);
14661 __tmp.put_u16_le(self.cog);
14662 __tmp.put_u8(self.fix_type as u8);
14663 __tmp.put_u8(self.satellites_visible);
14664 if matches!(version, MavlinkVersion::V2) {
14665 __tmp.put_i32_le(self.alt_ellipsoid);
14666 __tmp.put_u32_le(self.h_acc);
14667 __tmp.put_u32_le(self.v_acc);
14668 __tmp.put_u32_le(self.vel_acc);
14669 __tmp.put_u32_le(self.hdg_acc);
14670 __tmp.put_u16_le(self.yaw);
14671 let len = __tmp.len();
14672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14673 } else {
14674 __tmp.len()
14675 }
14676 }
14677}
14678#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14679#[doc = ""]
14680#[doc = "ID: 233"]
14681#[derive(Debug, Clone, PartialEq)]
14682#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14683#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14684#[cfg_attr(feature = "ts", derive(TS))]
14685#[cfg_attr(feature = "ts", ts(export))]
14686pub struct GPS_RTCM_DATA_DATA {
14687 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14688 pub flags: u8,
14689 #[doc = "data length"]
14690 pub len: u8,
14691 #[doc = "RTCM message (may be fragmented)"]
14692 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14693 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14694 pub data: [u8; 180],
14695}
14696impl GPS_RTCM_DATA_DATA {
14697 pub const ENCODED_LEN: usize = 182usize;
14698 pub const DEFAULT: Self = Self {
14699 flags: 0_u8,
14700 len: 0_u8,
14701 data: [0_u8; 180usize],
14702 };
14703 #[cfg(feature = "arbitrary")]
14704 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14705 use arbitrary::{Arbitrary, Unstructured};
14706 let mut buf = [0u8; 1024];
14707 rng.fill_bytes(&mut buf);
14708 let mut unstructured = Unstructured::new(&buf);
14709 Self::arbitrary(&mut unstructured).unwrap_or_default()
14710 }
14711}
14712impl Default for GPS_RTCM_DATA_DATA {
14713 fn default() -> Self {
14714 Self::DEFAULT.clone()
14715 }
14716}
14717impl MessageData for GPS_RTCM_DATA_DATA {
14718 type Message = MavMessage;
14719 const ID: u32 = 233u32;
14720 const NAME: &'static str = "GPS_RTCM_DATA";
14721 const EXTRA_CRC: u8 = 35u8;
14722 const ENCODED_LEN: usize = 182usize;
14723 fn deser(
14724 _version: MavlinkVersion,
14725 __input: &[u8],
14726 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14727 let avail_len = __input.len();
14728 let mut payload_buf = [0; Self::ENCODED_LEN];
14729 let mut buf = if avail_len < Self::ENCODED_LEN {
14730 payload_buf[0..avail_len].copy_from_slice(__input);
14731 Bytes::new(&payload_buf)
14732 } else {
14733 Bytes::new(__input)
14734 };
14735 let mut __struct = Self::default();
14736 __struct.flags = buf.get_u8();
14737 __struct.len = buf.get_u8();
14738 for v in &mut __struct.data {
14739 let val = buf.get_u8();
14740 *v = val;
14741 }
14742 Ok(__struct)
14743 }
14744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14745 let mut __tmp = BytesMut::new(bytes);
14746 #[allow(clippy::absurd_extreme_comparisons)]
14747 #[allow(unused_comparisons)]
14748 if __tmp.remaining() < Self::ENCODED_LEN {
14749 panic!(
14750 "buffer is too small (need {} bytes, but got {})",
14751 Self::ENCODED_LEN,
14752 __tmp.remaining(),
14753 )
14754 }
14755 __tmp.put_u8(self.flags);
14756 __tmp.put_u8(self.len);
14757 for val in &self.data {
14758 __tmp.put_u8(*val);
14759 }
14760 if matches!(version, MavlinkVersion::V2) {
14761 let len = __tmp.len();
14762 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14763 } else {
14764 __tmp.len()
14765 }
14766 }
14767}
14768#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14769#[doc = ""]
14770#[doc = "ID: 127"]
14771#[derive(Debug, Clone, PartialEq)]
14772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14773#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14774#[cfg_attr(feature = "ts", derive(TS))]
14775#[cfg_attr(feature = "ts", ts(export))]
14776pub struct GPS_RTK_DATA {
14777 #[doc = "Time since boot of last baseline message received."]
14778 pub time_last_baseline_ms: u32,
14779 #[doc = "GPS Time of Week of last baseline"]
14780 pub tow: u32,
14781 #[doc = "Current baseline in ECEF x or NED north component."]
14782 pub baseline_a_mm: i32,
14783 #[doc = "Current baseline in ECEF y or NED east component."]
14784 pub baseline_b_mm: i32,
14785 #[doc = "Current baseline in ECEF z or NED down component."]
14786 pub baseline_c_mm: i32,
14787 #[doc = "Current estimate of baseline accuracy."]
14788 pub accuracy: u32,
14789 #[doc = "Current number of integer ambiguity hypotheses."]
14790 pub iar_num_hypotheses: i32,
14791 #[doc = "GPS Week Number of last baseline"]
14792 pub wn: u16,
14793 #[doc = "Identification of connected RTK receiver."]
14794 pub rtk_receiver_id: u8,
14795 #[doc = "GPS-specific health report for RTK data."]
14796 pub rtk_health: u8,
14797 #[doc = "Rate of baseline messages being received by GPS"]
14798 pub rtk_rate: u8,
14799 #[doc = "Current number of sats used for RTK calculation."]
14800 pub nsats: u8,
14801 #[doc = "Coordinate system of baseline"]
14802 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14803}
14804impl GPS_RTK_DATA {
14805 pub const ENCODED_LEN: usize = 35usize;
14806 pub const DEFAULT: Self = Self {
14807 time_last_baseline_ms: 0_u32,
14808 tow: 0_u32,
14809 baseline_a_mm: 0_i32,
14810 baseline_b_mm: 0_i32,
14811 baseline_c_mm: 0_i32,
14812 accuracy: 0_u32,
14813 iar_num_hypotheses: 0_i32,
14814 wn: 0_u16,
14815 rtk_receiver_id: 0_u8,
14816 rtk_health: 0_u8,
14817 rtk_rate: 0_u8,
14818 nsats: 0_u8,
14819 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14820 };
14821 #[cfg(feature = "arbitrary")]
14822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14823 use arbitrary::{Arbitrary, Unstructured};
14824 let mut buf = [0u8; 1024];
14825 rng.fill_bytes(&mut buf);
14826 let mut unstructured = Unstructured::new(&buf);
14827 Self::arbitrary(&mut unstructured).unwrap_or_default()
14828 }
14829}
14830impl Default for GPS_RTK_DATA {
14831 fn default() -> Self {
14832 Self::DEFAULT.clone()
14833 }
14834}
14835impl MessageData for GPS_RTK_DATA {
14836 type Message = MavMessage;
14837 const ID: u32 = 127u32;
14838 const NAME: &'static str = "GPS_RTK";
14839 const EXTRA_CRC: u8 = 25u8;
14840 const ENCODED_LEN: usize = 35usize;
14841 fn deser(
14842 _version: MavlinkVersion,
14843 __input: &[u8],
14844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14845 let avail_len = __input.len();
14846 let mut payload_buf = [0; Self::ENCODED_LEN];
14847 let mut buf = if avail_len < Self::ENCODED_LEN {
14848 payload_buf[0..avail_len].copy_from_slice(__input);
14849 Bytes::new(&payload_buf)
14850 } else {
14851 Bytes::new(__input)
14852 };
14853 let mut __struct = Self::default();
14854 __struct.time_last_baseline_ms = buf.get_u32_le();
14855 __struct.tow = buf.get_u32_le();
14856 __struct.baseline_a_mm = buf.get_i32_le();
14857 __struct.baseline_b_mm = buf.get_i32_le();
14858 __struct.baseline_c_mm = buf.get_i32_le();
14859 __struct.accuracy = buf.get_u32_le();
14860 __struct.iar_num_hypotheses = buf.get_i32_le();
14861 __struct.wn = buf.get_u16_le();
14862 __struct.rtk_receiver_id = buf.get_u8();
14863 __struct.rtk_health = buf.get_u8();
14864 __struct.rtk_rate = buf.get_u8();
14865 __struct.nsats = buf.get_u8();
14866 let tmp = buf.get_u8();
14867 __struct.baseline_coords_type =
14868 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14869 enum_type: "RtkBaselineCoordinateSystem",
14870 value: tmp as u32,
14871 })?;
14872 Ok(__struct)
14873 }
14874 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14875 let mut __tmp = BytesMut::new(bytes);
14876 #[allow(clippy::absurd_extreme_comparisons)]
14877 #[allow(unused_comparisons)]
14878 if __tmp.remaining() < Self::ENCODED_LEN {
14879 panic!(
14880 "buffer is too small (need {} bytes, but got {})",
14881 Self::ENCODED_LEN,
14882 __tmp.remaining(),
14883 )
14884 }
14885 __tmp.put_u32_le(self.time_last_baseline_ms);
14886 __tmp.put_u32_le(self.tow);
14887 __tmp.put_i32_le(self.baseline_a_mm);
14888 __tmp.put_i32_le(self.baseline_b_mm);
14889 __tmp.put_i32_le(self.baseline_c_mm);
14890 __tmp.put_u32_le(self.accuracy);
14891 __tmp.put_i32_le(self.iar_num_hypotheses);
14892 __tmp.put_u16_le(self.wn);
14893 __tmp.put_u8(self.rtk_receiver_id);
14894 __tmp.put_u8(self.rtk_health);
14895 __tmp.put_u8(self.rtk_rate);
14896 __tmp.put_u8(self.nsats);
14897 __tmp.put_u8(self.baseline_coords_type as u8);
14898 if matches!(version, MavlinkVersion::V2) {
14899 let len = __tmp.len();
14900 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14901 } else {
14902 __tmp.len()
14903 }
14904 }
14905}
14906#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14907#[doc = ""]
14908#[doc = "ID: 25"]
14909#[derive(Debug, Clone, PartialEq)]
14910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14912#[cfg_attr(feature = "ts", derive(TS))]
14913#[cfg_attr(feature = "ts", ts(export))]
14914pub struct GPS_STATUS_DATA {
14915 #[doc = "Number of satellites visible"]
14916 pub satellites_visible: u8,
14917 #[doc = "Global satellite ID"]
14918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14919 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14920 pub satellite_prn: [u8; 20],
14921 #[doc = "0: Satellite not used, 1: used for localization"]
14922 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14923 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14924 pub satellite_used: [u8; 20],
14925 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14927 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14928 pub satellite_elevation: [u8; 20],
14929 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14930 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14931 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14932 pub satellite_azimuth: [u8; 20],
14933 #[doc = "Signal to noise ratio of satellite"]
14934 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14935 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14936 pub satellite_snr: [u8; 20],
14937}
14938impl GPS_STATUS_DATA {
14939 pub const ENCODED_LEN: usize = 101usize;
14940 pub const DEFAULT: Self = Self {
14941 satellites_visible: 0_u8,
14942 satellite_prn: [0_u8; 20usize],
14943 satellite_used: [0_u8; 20usize],
14944 satellite_elevation: [0_u8; 20usize],
14945 satellite_azimuth: [0_u8; 20usize],
14946 satellite_snr: [0_u8; 20usize],
14947 };
14948 #[cfg(feature = "arbitrary")]
14949 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14950 use arbitrary::{Arbitrary, Unstructured};
14951 let mut buf = [0u8; 1024];
14952 rng.fill_bytes(&mut buf);
14953 let mut unstructured = Unstructured::new(&buf);
14954 Self::arbitrary(&mut unstructured).unwrap_or_default()
14955 }
14956}
14957impl Default for GPS_STATUS_DATA {
14958 fn default() -> Self {
14959 Self::DEFAULT.clone()
14960 }
14961}
14962impl MessageData for GPS_STATUS_DATA {
14963 type Message = MavMessage;
14964 const ID: u32 = 25u32;
14965 const NAME: &'static str = "GPS_STATUS";
14966 const EXTRA_CRC: u8 = 23u8;
14967 const ENCODED_LEN: usize = 101usize;
14968 fn deser(
14969 _version: MavlinkVersion,
14970 __input: &[u8],
14971 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14972 let avail_len = __input.len();
14973 let mut payload_buf = [0; Self::ENCODED_LEN];
14974 let mut buf = if avail_len < Self::ENCODED_LEN {
14975 payload_buf[0..avail_len].copy_from_slice(__input);
14976 Bytes::new(&payload_buf)
14977 } else {
14978 Bytes::new(__input)
14979 };
14980 let mut __struct = Self::default();
14981 __struct.satellites_visible = buf.get_u8();
14982 for v in &mut __struct.satellite_prn {
14983 let val = buf.get_u8();
14984 *v = val;
14985 }
14986 for v in &mut __struct.satellite_used {
14987 let val = buf.get_u8();
14988 *v = val;
14989 }
14990 for v in &mut __struct.satellite_elevation {
14991 let val = buf.get_u8();
14992 *v = val;
14993 }
14994 for v in &mut __struct.satellite_azimuth {
14995 let val = buf.get_u8();
14996 *v = val;
14997 }
14998 for v in &mut __struct.satellite_snr {
14999 let val = buf.get_u8();
15000 *v = val;
15001 }
15002 Ok(__struct)
15003 }
15004 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15005 let mut __tmp = BytesMut::new(bytes);
15006 #[allow(clippy::absurd_extreme_comparisons)]
15007 #[allow(unused_comparisons)]
15008 if __tmp.remaining() < Self::ENCODED_LEN {
15009 panic!(
15010 "buffer is too small (need {} bytes, but got {})",
15011 Self::ENCODED_LEN,
15012 __tmp.remaining(),
15013 )
15014 }
15015 __tmp.put_u8(self.satellites_visible);
15016 for val in &self.satellite_prn {
15017 __tmp.put_u8(*val);
15018 }
15019 for val in &self.satellite_used {
15020 __tmp.put_u8(*val);
15021 }
15022 for val in &self.satellite_elevation {
15023 __tmp.put_u8(*val);
15024 }
15025 for val in &self.satellite_azimuth {
15026 __tmp.put_u8(*val);
15027 }
15028 for val in &self.satellite_snr {
15029 __tmp.put_u8(*val);
15030 }
15031 if matches!(version, MavlinkVersion::V2) {
15032 let len = __tmp.len();
15033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15034 } else {
15035 __tmp.len()
15036 }
15037 }
15038}
15039#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15040#[doc = ""]
15041#[doc = "ID: 0"]
15042#[derive(Debug, Clone, PartialEq)]
15043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15045#[cfg_attr(feature = "ts", derive(TS))]
15046#[cfg_attr(feature = "ts", ts(export))]
15047pub struct HEARTBEAT_DATA {
15048 #[doc = "A bitfield for use for autopilot-specific flags"]
15049 pub custom_mode: u32,
15050 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15051 pub mavtype: MavType,
15052 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15053 pub autopilot: MavAutopilot,
15054 #[doc = "System mode bitmap."]
15055 pub base_mode: MavModeFlag,
15056 #[doc = "System status flag."]
15057 pub system_status: MavState,
15058 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15059 pub mavlink_version: u8,
15060}
15061impl HEARTBEAT_DATA {
15062 pub const ENCODED_LEN: usize = 9usize;
15063 pub const DEFAULT: Self = Self {
15064 custom_mode: 0_u32,
15065 mavtype: MavType::DEFAULT,
15066 autopilot: MavAutopilot::DEFAULT,
15067 base_mode: MavModeFlag::DEFAULT,
15068 system_status: MavState::DEFAULT,
15069 mavlink_version: MINOR_MAVLINK_VERSION,
15070 };
15071 #[cfg(feature = "arbitrary")]
15072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15073 use arbitrary::{Arbitrary, Unstructured};
15074 let mut buf = [0u8; 1024];
15075 rng.fill_bytes(&mut buf);
15076 let mut unstructured = Unstructured::new(&buf);
15077 Self::arbitrary(&mut unstructured).unwrap_or_default()
15078 }
15079}
15080impl Default for HEARTBEAT_DATA {
15081 fn default() -> Self {
15082 Self::DEFAULT.clone()
15083 }
15084}
15085impl MessageData for HEARTBEAT_DATA {
15086 type Message = MavMessage;
15087 const ID: u32 = 0u32;
15088 const NAME: &'static str = "HEARTBEAT";
15089 const EXTRA_CRC: u8 = 50u8;
15090 const ENCODED_LEN: usize = 9usize;
15091 fn deser(
15092 _version: MavlinkVersion,
15093 __input: &[u8],
15094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15095 let avail_len = __input.len();
15096 let mut payload_buf = [0; Self::ENCODED_LEN];
15097 let mut buf = if avail_len < Self::ENCODED_LEN {
15098 payload_buf[0..avail_len].copy_from_slice(__input);
15099 Bytes::new(&payload_buf)
15100 } else {
15101 Bytes::new(__input)
15102 };
15103 let mut __struct = Self::default();
15104 __struct.custom_mode = buf.get_u32_le();
15105 let tmp = buf.get_u8();
15106 __struct.mavtype =
15107 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15108 enum_type: "MavType",
15109 value: tmp as u32,
15110 })?;
15111 let tmp = buf.get_u8();
15112 __struct.autopilot =
15113 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15114 enum_type: "MavAutopilot",
15115 value: tmp as u32,
15116 })?;
15117 let tmp = buf.get_u8();
15118 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15119 ::mavlink_core::error::ParserError::InvalidFlag {
15120 flag_type: "MavModeFlag",
15121 value: tmp as u32,
15122 },
15123 )?;
15124 let tmp = buf.get_u8();
15125 __struct.system_status =
15126 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15127 enum_type: "MavState",
15128 value: tmp as u32,
15129 })?;
15130 __struct.mavlink_version = buf.get_u8();
15131 Ok(__struct)
15132 }
15133 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15134 let mut __tmp = BytesMut::new(bytes);
15135 #[allow(clippy::absurd_extreme_comparisons)]
15136 #[allow(unused_comparisons)]
15137 if __tmp.remaining() < Self::ENCODED_LEN {
15138 panic!(
15139 "buffer is too small (need {} bytes, but got {})",
15140 Self::ENCODED_LEN,
15141 __tmp.remaining(),
15142 )
15143 }
15144 __tmp.put_u32_le(self.custom_mode);
15145 __tmp.put_u8(self.mavtype as u8);
15146 __tmp.put_u8(self.autopilot as u8);
15147 __tmp.put_u8(self.base_mode.bits());
15148 __tmp.put_u8(self.system_status as u8);
15149 __tmp.put_u8(self.mavlink_version);
15150 if matches!(version, MavlinkVersion::V2) {
15151 let len = __tmp.len();
15152 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15153 } else {
15154 __tmp.len()
15155 }
15156 }
15157}
15158#[doc = "Herelink Telemetry."]
15159#[doc = ""]
15160#[doc = "ID: 50003"]
15161#[derive(Debug, Clone, PartialEq)]
15162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15164#[cfg_attr(feature = "ts", derive(TS))]
15165#[cfg_attr(feature = "ts", ts(export))]
15166pub struct HERELINK_TELEM_DATA {
15167 pub rf_freq: u32,
15168 pub link_bw: u32,
15169 pub link_rate: u32,
15170 pub snr: i16,
15171 pub cpu_temp: i16,
15172 pub board_temp: i16,
15173 pub rssi: u8,
15174}
15175impl HERELINK_TELEM_DATA {
15176 pub const ENCODED_LEN: usize = 19usize;
15177 pub const DEFAULT: Self = Self {
15178 rf_freq: 0_u32,
15179 link_bw: 0_u32,
15180 link_rate: 0_u32,
15181 snr: 0_i16,
15182 cpu_temp: 0_i16,
15183 board_temp: 0_i16,
15184 rssi: 0_u8,
15185 };
15186 #[cfg(feature = "arbitrary")]
15187 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15188 use arbitrary::{Arbitrary, Unstructured};
15189 let mut buf = [0u8; 1024];
15190 rng.fill_bytes(&mut buf);
15191 let mut unstructured = Unstructured::new(&buf);
15192 Self::arbitrary(&mut unstructured).unwrap_or_default()
15193 }
15194}
15195impl Default for HERELINK_TELEM_DATA {
15196 fn default() -> Self {
15197 Self::DEFAULT.clone()
15198 }
15199}
15200impl MessageData for HERELINK_TELEM_DATA {
15201 type Message = MavMessage;
15202 const ID: u32 = 50003u32;
15203 const NAME: &'static str = "HERELINK_TELEM";
15204 const EXTRA_CRC: u8 = 62u8;
15205 const ENCODED_LEN: usize = 19usize;
15206 fn deser(
15207 _version: MavlinkVersion,
15208 __input: &[u8],
15209 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15210 let avail_len = __input.len();
15211 let mut payload_buf = [0; Self::ENCODED_LEN];
15212 let mut buf = if avail_len < Self::ENCODED_LEN {
15213 payload_buf[0..avail_len].copy_from_slice(__input);
15214 Bytes::new(&payload_buf)
15215 } else {
15216 Bytes::new(__input)
15217 };
15218 let mut __struct = Self::default();
15219 __struct.rf_freq = buf.get_u32_le();
15220 __struct.link_bw = buf.get_u32_le();
15221 __struct.link_rate = buf.get_u32_le();
15222 __struct.snr = buf.get_i16_le();
15223 __struct.cpu_temp = buf.get_i16_le();
15224 __struct.board_temp = buf.get_i16_le();
15225 __struct.rssi = buf.get_u8();
15226 Ok(__struct)
15227 }
15228 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15229 let mut __tmp = BytesMut::new(bytes);
15230 #[allow(clippy::absurd_extreme_comparisons)]
15231 #[allow(unused_comparisons)]
15232 if __tmp.remaining() < Self::ENCODED_LEN {
15233 panic!(
15234 "buffer is too small (need {} bytes, but got {})",
15235 Self::ENCODED_LEN,
15236 __tmp.remaining(),
15237 )
15238 }
15239 __tmp.put_u32_le(self.rf_freq);
15240 __tmp.put_u32_le(self.link_bw);
15241 __tmp.put_u32_le(self.link_rate);
15242 __tmp.put_i16_le(self.snr);
15243 __tmp.put_i16_le(self.cpu_temp);
15244 __tmp.put_i16_le(self.board_temp);
15245 __tmp.put_u8(self.rssi);
15246 if matches!(version, MavlinkVersion::V2) {
15247 let len = __tmp.len();
15248 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15249 } else {
15250 __tmp.len()
15251 }
15252 }
15253}
15254#[doc = "Information about video stream."]
15255#[doc = ""]
15256#[doc = "ID: 50002"]
15257#[derive(Debug, Clone, PartialEq)]
15258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15260#[cfg_attr(feature = "ts", derive(TS))]
15261#[cfg_attr(feature = "ts", ts(export))]
15262pub struct HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15263 #[doc = "Frame rate."]
15264 pub framerate: f32,
15265 #[doc = "Bit rate."]
15266 pub bitrate: u32,
15267 #[doc = "Horizontal resolution."]
15268 pub resolution_h: u16,
15269 #[doc = "Vertical resolution."]
15270 pub resolution_v: u16,
15271 #[doc = "Video image rotation clockwise."]
15272 pub rotation: u16,
15273 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
15274 pub camera_id: u8,
15275 #[doc = "Number of streams available."]
15276 pub status: u8,
15277 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
15278 #[cfg_attr(feature = "ts", ts(type = "string"))]
15279 pub uri: CharArray<230>,
15280}
15281impl HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15282 pub const ENCODED_LEN: usize = 246usize;
15283 pub const DEFAULT: Self = Self {
15284 framerate: 0.0_f32,
15285 bitrate: 0_u32,
15286 resolution_h: 0_u16,
15287 resolution_v: 0_u16,
15288 rotation: 0_u16,
15289 camera_id: 0_u8,
15290 status: 0_u8,
15291 uri: CharArray::new([0_u8; 230usize]),
15292 };
15293 #[cfg(feature = "arbitrary")]
15294 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15295 use arbitrary::{Arbitrary, Unstructured};
15296 let mut buf = [0u8; 1024];
15297 rng.fill_bytes(&mut buf);
15298 let mut unstructured = Unstructured::new(&buf);
15299 Self::arbitrary(&mut unstructured).unwrap_or_default()
15300 }
15301}
15302impl Default for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15303 fn default() -> Self {
15304 Self::DEFAULT.clone()
15305 }
15306}
15307impl MessageData for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15308 type Message = MavMessage;
15309 const ID: u32 = 50002u32;
15310 const NAME: &'static str = "HERELINK_VIDEO_STREAM_INFORMATION";
15311 const EXTRA_CRC: u8 = 181u8;
15312 const ENCODED_LEN: usize = 246usize;
15313 fn deser(
15314 _version: MavlinkVersion,
15315 __input: &[u8],
15316 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15317 let avail_len = __input.len();
15318 let mut payload_buf = [0; Self::ENCODED_LEN];
15319 let mut buf = if avail_len < Self::ENCODED_LEN {
15320 payload_buf[0..avail_len].copy_from_slice(__input);
15321 Bytes::new(&payload_buf)
15322 } else {
15323 Bytes::new(__input)
15324 };
15325 let mut __struct = Self::default();
15326 __struct.framerate = buf.get_f32_le();
15327 __struct.bitrate = buf.get_u32_le();
15328 __struct.resolution_h = buf.get_u16_le();
15329 __struct.resolution_v = buf.get_u16_le();
15330 __struct.rotation = buf.get_u16_le();
15331 __struct.camera_id = buf.get_u8();
15332 __struct.status = buf.get_u8();
15333 let mut tmp = [0_u8; 230usize];
15334 for v in &mut tmp {
15335 *v = buf.get_u8();
15336 }
15337 __struct.uri = CharArray::new(tmp);
15338 Ok(__struct)
15339 }
15340 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15341 let mut __tmp = BytesMut::new(bytes);
15342 #[allow(clippy::absurd_extreme_comparisons)]
15343 #[allow(unused_comparisons)]
15344 if __tmp.remaining() < Self::ENCODED_LEN {
15345 panic!(
15346 "buffer is too small (need {} bytes, but got {})",
15347 Self::ENCODED_LEN,
15348 __tmp.remaining(),
15349 )
15350 }
15351 __tmp.put_f32_le(self.framerate);
15352 __tmp.put_u32_le(self.bitrate);
15353 __tmp.put_u16_le(self.resolution_h);
15354 __tmp.put_u16_le(self.resolution_v);
15355 __tmp.put_u16_le(self.rotation);
15356 __tmp.put_u8(self.camera_id);
15357 __tmp.put_u8(self.status);
15358 for val in &self.uri {
15359 __tmp.put_u8(*val);
15360 }
15361 if matches!(version, MavlinkVersion::V2) {
15362 let len = __tmp.len();
15363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15364 } else {
15365 __tmp.len()
15366 }
15367 }
15368}
15369#[doc = "The IMU readings in SI units in NED body frame."]
15370#[doc = ""]
15371#[doc = "ID: 105"]
15372#[derive(Debug, Clone, PartialEq)]
15373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15375#[cfg_attr(feature = "ts", derive(TS))]
15376#[cfg_attr(feature = "ts", ts(export))]
15377pub struct HIGHRES_IMU_DATA {
15378 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15379 pub time_usec: u64,
15380 #[doc = "X acceleration"]
15381 pub xacc: f32,
15382 #[doc = "Y acceleration"]
15383 pub yacc: f32,
15384 #[doc = "Z acceleration"]
15385 pub zacc: f32,
15386 #[doc = "Angular speed around X axis"]
15387 pub xgyro: f32,
15388 #[doc = "Angular speed around Y axis"]
15389 pub ygyro: f32,
15390 #[doc = "Angular speed around Z axis"]
15391 pub zgyro: f32,
15392 #[doc = "X Magnetic field"]
15393 pub xmag: f32,
15394 #[doc = "Y Magnetic field"]
15395 pub ymag: f32,
15396 #[doc = "Z Magnetic field"]
15397 pub zmag: f32,
15398 #[doc = "Absolute pressure"]
15399 pub abs_pressure: f32,
15400 #[doc = "Differential pressure"]
15401 pub diff_pressure: f32,
15402 #[doc = "Altitude calculated from pressure"]
15403 pub pressure_alt: f32,
15404 #[doc = "Temperature"]
15405 pub temperature: f32,
15406 #[doc = "Bitmap for fields that have updated since last message"]
15407 pub fields_updated: HighresImuUpdatedFlags,
15408 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15409 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15410 pub id: u8,
15411}
15412impl HIGHRES_IMU_DATA {
15413 pub const ENCODED_LEN: usize = 63usize;
15414 pub const DEFAULT: Self = Self {
15415 time_usec: 0_u64,
15416 xacc: 0.0_f32,
15417 yacc: 0.0_f32,
15418 zacc: 0.0_f32,
15419 xgyro: 0.0_f32,
15420 ygyro: 0.0_f32,
15421 zgyro: 0.0_f32,
15422 xmag: 0.0_f32,
15423 ymag: 0.0_f32,
15424 zmag: 0.0_f32,
15425 abs_pressure: 0.0_f32,
15426 diff_pressure: 0.0_f32,
15427 pressure_alt: 0.0_f32,
15428 temperature: 0.0_f32,
15429 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15430 id: 0_u8,
15431 };
15432 #[cfg(feature = "arbitrary")]
15433 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15434 use arbitrary::{Arbitrary, Unstructured};
15435 let mut buf = [0u8; 1024];
15436 rng.fill_bytes(&mut buf);
15437 let mut unstructured = Unstructured::new(&buf);
15438 Self::arbitrary(&mut unstructured).unwrap_or_default()
15439 }
15440}
15441impl Default for HIGHRES_IMU_DATA {
15442 fn default() -> Self {
15443 Self::DEFAULT.clone()
15444 }
15445}
15446impl MessageData for HIGHRES_IMU_DATA {
15447 type Message = MavMessage;
15448 const ID: u32 = 105u32;
15449 const NAME: &'static str = "HIGHRES_IMU";
15450 const EXTRA_CRC: u8 = 93u8;
15451 const ENCODED_LEN: usize = 63usize;
15452 fn deser(
15453 _version: MavlinkVersion,
15454 __input: &[u8],
15455 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15456 let avail_len = __input.len();
15457 let mut payload_buf = [0; Self::ENCODED_LEN];
15458 let mut buf = if avail_len < Self::ENCODED_LEN {
15459 payload_buf[0..avail_len].copy_from_slice(__input);
15460 Bytes::new(&payload_buf)
15461 } else {
15462 Bytes::new(__input)
15463 };
15464 let mut __struct = Self::default();
15465 __struct.time_usec = buf.get_u64_le();
15466 __struct.xacc = buf.get_f32_le();
15467 __struct.yacc = buf.get_f32_le();
15468 __struct.zacc = buf.get_f32_le();
15469 __struct.xgyro = buf.get_f32_le();
15470 __struct.ygyro = buf.get_f32_le();
15471 __struct.zgyro = buf.get_f32_le();
15472 __struct.xmag = buf.get_f32_le();
15473 __struct.ymag = buf.get_f32_le();
15474 __struct.zmag = buf.get_f32_le();
15475 __struct.abs_pressure = buf.get_f32_le();
15476 __struct.diff_pressure = buf.get_f32_le();
15477 __struct.pressure_alt = buf.get_f32_le();
15478 __struct.temperature = buf.get_f32_le();
15479 let tmp = buf.get_u16_le();
15480 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15481 tmp & HighresImuUpdatedFlags::all().bits(),
15482 )
15483 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15484 flag_type: "HighresImuUpdatedFlags",
15485 value: tmp as u32,
15486 })?;
15487 __struct.id = buf.get_u8();
15488 Ok(__struct)
15489 }
15490 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15491 let mut __tmp = BytesMut::new(bytes);
15492 #[allow(clippy::absurd_extreme_comparisons)]
15493 #[allow(unused_comparisons)]
15494 if __tmp.remaining() < Self::ENCODED_LEN {
15495 panic!(
15496 "buffer is too small (need {} bytes, but got {})",
15497 Self::ENCODED_LEN,
15498 __tmp.remaining(),
15499 )
15500 }
15501 __tmp.put_u64_le(self.time_usec);
15502 __tmp.put_f32_le(self.xacc);
15503 __tmp.put_f32_le(self.yacc);
15504 __tmp.put_f32_le(self.zacc);
15505 __tmp.put_f32_le(self.xgyro);
15506 __tmp.put_f32_le(self.ygyro);
15507 __tmp.put_f32_le(self.zgyro);
15508 __tmp.put_f32_le(self.xmag);
15509 __tmp.put_f32_le(self.ymag);
15510 __tmp.put_f32_le(self.zmag);
15511 __tmp.put_f32_le(self.abs_pressure);
15512 __tmp.put_f32_le(self.diff_pressure);
15513 __tmp.put_f32_le(self.pressure_alt);
15514 __tmp.put_f32_le(self.temperature);
15515 __tmp.put_u16_le(self.fields_updated.bits());
15516 if matches!(version, MavlinkVersion::V2) {
15517 __tmp.put_u8(self.id);
15518 let len = __tmp.len();
15519 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15520 } else {
15521 __tmp.len()
15522 }
15523 }
15524}
15525#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15526#[doc = "Message appropriate for high latency connections like Iridium."]
15527#[doc = ""]
15528#[doc = "ID: 234"]
15529#[derive(Debug, Clone, PartialEq)]
15530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15532#[cfg_attr(feature = "ts", derive(TS))]
15533#[cfg_attr(feature = "ts", ts(export))]
15534pub struct HIGH_LATENCY_DATA {
15535 #[doc = "A bitfield for use for autopilot-specific flags."]
15536 pub custom_mode: u32,
15537 #[doc = "Latitude"]
15538 pub latitude: i32,
15539 #[doc = "Longitude"]
15540 pub longitude: i32,
15541 #[doc = "roll"]
15542 pub roll: i16,
15543 #[doc = "pitch"]
15544 pub pitch: i16,
15545 #[doc = "heading"]
15546 pub heading: u16,
15547 #[doc = "heading setpoint"]
15548 pub heading_sp: i16,
15549 #[doc = "Altitude above mean sea level"]
15550 pub altitude_amsl: i16,
15551 #[doc = "Altitude setpoint relative to the home position"]
15552 pub altitude_sp: i16,
15553 #[doc = "distance to target"]
15554 pub wp_distance: u16,
15555 #[doc = "Bitmap of enabled system modes."]
15556 pub base_mode: MavModeFlag,
15557 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15558 pub landed_state: MavLandedState,
15559 #[doc = "throttle (percentage)"]
15560 pub throttle: i8,
15561 #[doc = "airspeed"]
15562 pub airspeed: u8,
15563 #[doc = "airspeed setpoint"]
15564 pub airspeed_sp: u8,
15565 #[doc = "groundspeed"]
15566 pub groundspeed: u8,
15567 #[doc = "climb rate"]
15568 pub climb_rate: i8,
15569 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15570 pub gps_nsat: u8,
15571 #[doc = "GPS Fix type."]
15572 pub gps_fix_type: GpsFixType,
15573 #[doc = "Remaining battery (percentage)"]
15574 pub battery_remaining: u8,
15575 #[doc = "Autopilot temperature (degrees C)"]
15576 pub temperature: i8,
15577 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15578 pub temperature_air: i8,
15579 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15580 pub failsafe: u8,
15581 #[doc = "current waypoint number"]
15582 pub wp_num: u8,
15583}
15584impl HIGH_LATENCY_DATA {
15585 pub const ENCODED_LEN: usize = 40usize;
15586 pub const DEFAULT: Self = Self {
15587 custom_mode: 0_u32,
15588 latitude: 0_i32,
15589 longitude: 0_i32,
15590 roll: 0_i16,
15591 pitch: 0_i16,
15592 heading: 0_u16,
15593 heading_sp: 0_i16,
15594 altitude_amsl: 0_i16,
15595 altitude_sp: 0_i16,
15596 wp_distance: 0_u16,
15597 base_mode: MavModeFlag::DEFAULT,
15598 landed_state: MavLandedState::DEFAULT,
15599 throttle: 0_i8,
15600 airspeed: 0_u8,
15601 airspeed_sp: 0_u8,
15602 groundspeed: 0_u8,
15603 climb_rate: 0_i8,
15604 gps_nsat: 0_u8,
15605 gps_fix_type: GpsFixType::DEFAULT,
15606 battery_remaining: 0_u8,
15607 temperature: 0_i8,
15608 temperature_air: 0_i8,
15609 failsafe: 0_u8,
15610 wp_num: 0_u8,
15611 };
15612 #[cfg(feature = "arbitrary")]
15613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15614 use arbitrary::{Arbitrary, Unstructured};
15615 let mut buf = [0u8; 1024];
15616 rng.fill_bytes(&mut buf);
15617 let mut unstructured = Unstructured::new(&buf);
15618 Self::arbitrary(&mut unstructured).unwrap_or_default()
15619 }
15620}
15621impl Default for HIGH_LATENCY_DATA {
15622 fn default() -> Self {
15623 Self::DEFAULT.clone()
15624 }
15625}
15626impl MessageData for HIGH_LATENCY_DATA {
15627 type Message = MavMessage;
15628 const ID: u32 = 234u32;
15629 const NAME: &'static str = "HIGH_LATENCY";
15630 const EXTRA_CRC: u8 = 150u8;
15631 const ENCODED_LEN: usize = 40usize;
15632 fn deser(
15633 _version: MavlinkVersion,
15634 __input: &[u8],
15635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15636 let avail_len = __input.len();
15637 let mut payload_buf = [0; Self::ENCODED_LEN];
15638 let mut buf = if avail_len < Self::ENCODED_LEN {
15639 payload_buf[0..avail_len].copy_from_slice(__input);
15640 Bytes::new(&payload_buf)
15641 } else {
15642 Bytes::new(__input)
15643 };
15644 let mut __struct = Self::default();
15645 __struct.custom_mode = buf.get_u32_le();
15646 __struct.latitude = buf.get_i32_le();
15647 __struct.longitude = buf.get_i32_le();
15648 __struct.roll = buf.get_i16_le();
15649 __struct.pitch = buf.get_i16_le();
15650 __struct.heading = buf.get_u16_le();
15651 __struct.heading_sp = buf.get_i16_le();
15652 __struct.altitude_amsl = buf.get_i16_le();
15653 __struct.altitude_sp = buf.get_i16_le();
15654 __struct.wp_distance = buf.get_u16_le();
15655 let tmp = buf.get_u8();
15656 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15657 ::mavlink_core::error::ParserError::InvalidFlag {
15658 flag_type: "MavModeFlag",
15659 value: tmp as u32,
15660 },
15661 )?;
15662 let tmp = buf.get_u8();
15663 __struct.landed_state =
15664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15665 enum_type: "MavLandedState",
15666 value: tmp as u32,
15667 })?;
15668 __struct.throttle = buf.get_i8();
15669 __struct.airspeed = buf.get_u8();
15670 __struct.airspeed_sp = buf.get_u8();
15671 __struct.groundspeed = buf.get_u8();
15672 __struct.climb_rate = buf.get_i8();
15673 __struct.gps_nsat = buf.get_u8();
15674 let tmp = buf.get_u8();
15675 __struct.gps_fix_type =
15676 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15677 enum_type: "GpsFixType",
15678 value: tmp as u32,
15679 })?;
15680 __struct.battery_remaining = buf.get_u8();
15681 __struct.temperature = buf.get_i8();
15682 __struct.temperature_air = buf.get_i8();
15683 __struct.failsafe = buf.get_u8();
15684 __struct.wp_num = buf.get_u8();
15685 Ok(__struct)
15686 }
15687 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15688 let mut __tmp = BytesMut::new(bytes);
15689 #[allow(clippy::absurd_extreme_comparisons)]
15690 #[allow(unused_comparisons)]
15691 if __tmp.remaining() < Self::ENCODED_LEN {
15692 panic!(
15693 "buffer is too small (need {} bytes, but got {})",
15694 Self::ENCODED_LEN,
15695 __tmp.remaining(),
15696 )
15697 }
15698 __tmp.put_u32_le(self.custom_mode);
15699 __tmp.put_i32_le(self.latitude);
15700 __tmp.put_i32_le(self.longitude);
15701 __tmp.put_i16_le(self.roll);
15702 __tmp.put_i16_le(self.pitch);
15703 __tmp.put_u16_le(self.heading);
15704 __tmp.put_i16_le(self.heading_sp);
15705 __tmp.put_i16_le(self.altitude_amsl);
15706 __tmp.put_i16_le(self.altitude_sp);
15707 __tmp.put_u16_le(self.wp_distance);
15708 __tmp.put_u8(self.base_mode.bits());
15709 __tmp.put_u8(self.landed_state as u8);
15710 __tmp.put_i8(self.throttle);
15711 __tmp.put_u8(self.airspeed);
15712 __tmp.put_u8(self.airspeed_sp);
15713 __tmp.put_u8(self.groundspeed);
15714 __tmp.put_i8(self.climb_rate);
15715 __tmp.put_u8(self.gps_nsat);
15716 __tmp.put_u8(self.gps_fix_type as u8);
15717 __tmp.put_u8(self.battery_remaining);
15718 __tmp.put_i8(self.temperature);
15719 __tmp.put_i8(self.temperature_air);
15720 __tmp.put_u8(self.failsafe);
15721 __tmp.put_u8(self.wp_num);
15722 if matches!(version, MavlinkVersion::V2) {
15723 let len = __tmp.len();
15724 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15725 } else {
15726 __tmp.len()
15727 }
15728 }
15729}
15730#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15731#[doc = ""]
15732#[doc = "ID: 235"]
15733#[derive(Debug, Clone, PartialEq)]
15734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15736#[cfg_attr(feature = "ts", derive(TS))]
15737#[cfg_attr(feature = "ts", ts(export))]
15738pub struct HIGH_LATENCY2_DATA {
15739 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15740 pub timestamp: u32,
15741 #[doc = "Latitude"]
15742 pub latitude: i32,
15743 #[doc = "Longitude"]
15744 pub longitude: i32,
15745 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15746 pub custom_mode: u16,
15747 #[doc = "Altitude above mean sea level"]
15748 pub altitude: i16,
15749 #[doc = "Altitude setpoint"]
15750 pub target_altitude: i16,
15751 #[doc = "Distance to target waypoint or position"]
15752 pub target_distance: u16,
15753 #[doc = "Current waypoint number"]
15754 pub wp_num: u16,
15755 #[doc = "Bitmap of failure flags."]
15756 pub failure_flags: HlFailureFlag,
15757 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15758 pub mavtype: MavType,
15759 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15760 pub autopilot: MavAutopilot,
15761 #[doc = "Heading"]
15762 pub heading: u8,
15763 #[doc = "Heading setpoint"]
15764 pub target_heading: u8,
15765 #[doc = "Throttle"]
15766 pub throttle: u8,
15767 #[doc = "Airspeed"]
15768 pub airspeed: u8,
15769 #[doc = "Airspeed setpoint"]
15770 pub airspeed_sp: u8,
15771 #[doc = "Groundspeed"]
15772 pub groundspeed: u8,
15773 #[doc = "Windspeed"]
15774 pub windspeed: u8,
15775 #[doc = "Wind heading"]
15776 pub wind_heading: u8,
15777 #[doc = "Maximum error horizontal position since last message"]
15778 pub eph: u8,
15779 #[doc = "Maximum error vertical position since last message"]
15780 pub epv: u8,
15781 #[doc = "Air temperature"]
15782 pub temperature_air: i8,
15783 #[doc = "Maximum climb rate magnitude since last message"]
15784 pub climb_rate: i8,
15785 #[doc = "Battery level (-1 if field not provided)."]
15786 pub battery: i8,
15787 #[doc = "Field for custom payload."]
15788 pub custom0: i8,
15789 #[doc = "Field for custom payload."]
15790 pub custom1: i8,
15791 #[doc = "Field for custom payload."]
15792 pub custom2: i8,
15793}
15794impl HIGH_LATENCY2_DATA {
15795 pub const ENCODED_LEN: usize = 42usize;
15796 pub const DEFAULT: Self = Self {
15797 timestamp: 0_u32,
15798 latitude: 0_i32,
15799 longitude: 0_i32,
15800 custom_mode: 0_u16,
15801 altitude: 0_i16,
15802 target_altitude: 0_i16,
15803 target_distance: 0_u16,
15804 wp_num: 0_u16,
15805 failure_flags: HlFailureFlag::DEFAULT,
15806 mavtype: MavType::DEFAULT,
15807 autopilot: MavAutopilot::DEFAULT,
15808 heading: 0_u8,
15809 target_heading: 0_u8,
15810 throttle: 0_u8,
15811 airspeed: 0_u8,
15812 airspeed_sp: 0_u8,
15813 groundspeed: 0_u8,
15814 windspeed: 0_u8,
15815 wind_heading: 0_u8,
15816 eph: 0_u8,
15817 epv: 0_u8,
15818 temperature_air: 0_i8,
15819 climb_rate: 0_i8,
15820 battery: 0_i8,
15821 custom0: 0_i8,
15822 custom1: 0_i8,
15823 custom2: 0_i8,
15824 };
15825 #[cfg(feature = "arbitrary")]
15826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15827 use arbitrary::{Arbitrary, Unstructured};
15828 let mut buf = [0u8; 1024];
15829 rng.fill_bytes(&mut buf);
15830 let mut unstructured = Unstructured::new(&buf);
15831 Self::arbitrary(&mut unstructured).unwrap_or_default()
15832 }
15833}
15834impl Default for HIGH_LATENCY2_DATA {
15835 fn default() -> Self {
15836 Self::DEFAULT.clone()
15837 }
15838}
15839impl MessageData for HIGH_LATENCY2_DATA {
15840 type Message = MavMessage;
15841 const ID: u32 = 235u32;
15842 const NAME: &'static str = "HIGH_LATENCY2";
15843 const EXTRA_CRC: u8 = 179u8;
15844 const ENCODED_LEN: usize = 42usize;
15845 fn deser(
15846 _version: MavlinkVersion,
15847 __input: &[u8],
15848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15849 let avail_len = __input.len();
15850 let mut payload_buf = [0; Self::ENCODED_LEN];
15851 let mut buf = if avail_len < Self::ENCODED_LEN {
15852 payload_buf[0..avail_len].copy_from_slice(__input);
15853 Bytes::new(&payload_buf)
15854 } else {
15855 Bytes::new(__input)
15856 };
15857 let mut __struct = Self::default();
15858 __struct.timestamp = buf.get_u32_le();
15859 __struct.latitude = buf.get_i32_le();
15860 __struct.longitude = buf.get_i32_le();
15861 __struct.custom_mode = buf.get_u16_le();
15862 __struct.altitude = buf.get_i16_le();
15863 __struct.target_altitude = buf.get_i16_le();
15864 __struct.target_distance = buf.get_u16_le();
15865 __struct.wp_num = buf.get_u16_le();
15866 let tmp = buf.get_u16_le();
15867 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15868 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15869 flag_type: "HlFailureFlag",
15870 value: tmp as u32,
15871 })?;
15872 let tmp = buf.get_u8();
15873 __struct.mavtype =
15874 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15875 enum_type: "MavType",
15876 value: tmp as u32,
15877 })?;
15878 let tmp = buf.get_u8();
15879 __struct.autopilot =
15880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15881 enum_type: "MavAutopilot",
15882 value: tmp as u32,
15883 })?;
15884 __struct.heading = buf.get_u8();
15885 __struct.target_heading = buf.get_u8();
15886 __struct.throttle = buf.get_u8();
15887 __struct.airspeed = buf.get_u8();
15888 __struct.airspeed_sp = buf.get_u8();
15889 __struct.groundspeed = buf.get_u8();
15890 __struct.windspeed = buf.get_u8();
15891 __struct.wind_heading = buf.get_u8();
15892 __struct.eph = buf.get_u8();
15893 __struct.epv = buf.get_u8();
15894 __struct.temperature_air = buf.get_i8();
15895 __struct.climb_rate = buf.get_i8();
15896 __struct.battery = buf.get_i8();
15897 __struct.custom0 = buf.get_i8();
15898 __struct.custom1 = buf.get_i8();
15899 __struct.custom2 = buf.get_i8();
15900 Ok(__struct)
15901 }
15902 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15903 let mut __tmp = BytesMut::new(bytes);
15904 #[allow(clippy::absurd_extreme_comparisons)]
15905 #[allow(unused_comparisons)]
15906 if __tmp.remaining() < Self::ENCODED_LEN {
15907 panic!(
15908 "buffer is too small (need {} bytes, but got {})",
15909 Self::ENCODED_LEN,
15910 __tmp.remaining(),
15911 )
15912 }
15913 __tmp.put_u32_le(self.timestamp);
15914 __tmp.put_i32_le(self.latitude);
15915 __tmp.put_i32_le(self.longitude);
15916 __tmp.put_u16_le(self.custom_mode);
15917 __tmp.put_i16_le(self.altitude);
15918 __tmp.put_i16_le(self.target_altitude);
15919 __tmp.put_u16_le(self.target_distance);
15920 __tmp.put_u16_le(self.wp_num);
15921 __tmp.put_u16_le(self.failure_flags.bits());
15922 __tmp.put_u8(self.mavtype as u8);
15923 __tmp.put_u8(self.autopilot as u8);
15924 __tmp.put_u8(self.heading);
15925 __tmp.put_u8(self.target_heading);
15926 __tmp.put_u8(self.throttle);
15927 __tmp.put_u8(self.airspeed);
15928 __tmp.put_u8(self.airspeed_sp);
15929 __tmp.put_u8(self.groundspeed);
15930 __tmp.put_u8(self.windspeed);
15931 __tmp.put_u8(self.wind_heading);
15932 __tmp.put_u8(self.eph);
15933 __tmp.put_u8(self.epv);
15934 __tmp.put_i8(self.temperature_air);
15935 __tmp.put_i8(self.climb_rate);
15936 __tmp.put_i8(self.battery);
15937 __tmp.put_i8(self.custom0);
15938 __tmp.put_i8(self.custom1);
15939 __tmp.put_i8(self.custom2);
15940 if matches!(version, MavlinkVersion::V2) {
15941 let len = __tmp.len();
15942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15943 } else {
15944 __tmp.len()
15945 }
15946 }
15947}
15948#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15949#[doc = ""]
15950#[doc = "ID: 93"]
15951#[derive(Debug, Clone, PartialEq)]
15952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15954#[cfg_attr(feature = "ts", derive(TS))]
15955#[cfg_attr(feature = "ts", ts(export))]
15956pub struct HIL_ACTUATOR_CONTROLS_DATA {
15957 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15958 pub time_usec: u64,
15959 #[doc = "Flags bitmask."]
15960 pub flags: HilActuatorControlsFlags,
15961 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15962 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15963 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15964 pub controls: [f32; 16],
15965 #[doc = "System mode. Includes arming state."]
15966 pub mode: MavModeFlag,
15967}
15968impl HIL_ACTUATOR_CONTROLS_DATA {
15969 pub const ENCODED_LEN: usize = 81usize;
15970 pub const DEFAULT: Self = Self {
15971 time_usec: 0_u64,
15972 flags: HilActuatorControlsFlags::DEFAULT,
15973 controls: [0.0_f32; 16usize],
15974 mode: MavModeFlag::DEFAULT,
15975 };
15976 #[cfg(feature = "arbitrary")]
15977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15978 use arbitrary::{Arbitrary, Unstructured};
15979 let mut buf = [0u8; 1024];
15980 rng.fill_bytes(&mut buf);
15981 let mut unstructured = Unstructured::new(&buf);
15982 Self::arbitrary(&mut unstructured).unwrap_or_default()
15983 }
15984}
15985impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15986 fn default() -> Self {
15987 Self::DEFAULT.clone()
15988 }
15989}
15990impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15991 type Message = MavMessage;
15992 const ID: u32 = 93u32;
15993 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15994 const EXTRA_CRC: u8 = 47u8;
15995 const ENCODED_LEN: usize = 81usize;
15996 fn deser(
15997 _version: MavlinkVersion,
15998 __input: &[u8],
15999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16000 let avail_len = __input.len();
16001 let mut payload_buf = [0; Self::ENCODED_LEN];
16002 let mut buf = if avail_len < Self::ENCODED_LEN {
16003 payload_buf[0..avail_len].copy_from_slice(__input);
16004 Bytes::new(&payload_buf)
16005 } else {
16006 Bytes::new(__input)
16007 };
16008 let mut __struct = Self::default();
16009 __struct.time_usec = buf.get_u64_le();
16010 let tmp = buf.get_u64_le();
16011 __struct.flags =
16012 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
16013 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16014 flag_type: "HilActuatorControlsFlags",
16015 value: tmp as u32,
16016 })?;
16017 for v in &mut __struct.controls {
16018 let val = buf.get_f32_le();
16019 *v = val;
16020 }
16021 let tmp = buf.get_u8();
16022 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16023 ::mavlink_core::error::ParserError::InvalidFlag {
16024 flag_type: "MavModeFlag",
16025 value: tmp as u32,
16026 },
16027 )?;
16028 Ok(__struct)
16029 }
16030 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16031 let mut __tmp = BytesMut::new(bytes);
16032 #[allow(clippy::absurd_extreme_comparisons)]
16033 #[allow(unused_comparisons)]
16034 if __tmp.remaining() < Self::ENCODED_LEN {
16035 panic!(
16036 "buffer is too small (need {} bytes, but got {})",
16037 Self::ENCODED_LEN,
16038 __tmp.remaining(),
16039 )
16040 }
16041 __tmp.put_u64_le(self.time_usec);
16042 __tmp.put_u64_le(self.flags.bits());
16043 for val in &self.controls {
16044 __tmp.put_f32_le(*val);
16045 }
16046 __tmp.put_u8(self.mode.bits());
16047 if matches!(version, MavlinkVersion::V2) {
16048 let len = __tmp.len();
16049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16050 } else {
16051 __tmp.len()
16052 }
16053 }
16054}
16055#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16056#[doc = ""]
16057#[doc = "ID: 91"]
16058#[derive(Debug, Clone, PartialEq)]
16059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16061#[cfg_attr(feature = "ts", derive(TS))]
16062#[cfg_attr(feature = "ts", ts(export))]
16063pub struct HIL_CONTROLS_DATA {
16064 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16065 pub time_usec: u64,
16066 #[doc = "Control output -1 .. 1"]
16067 pub roll_ailerons: f32,
16068 #[doc = "Control output -1 .. 1"]
16069 pub pitch_elevator: f32,
16070 #[doc = "Control output -1 .. 1"]
16071 pub yaw_rudder: f32,
16072 #[doc = "Throttle 0 .. 1"]
16073 pub throttle: f32,
16074 #[doc = "Aux 1, -1 .. 1"]
16075 pub aux1: f32,
16076 #[doc = "Aux 2, -1 .. 1"]
16077 pub aux2: f32,
16078 #[doc = "Aux 3, -1 .. 1"]
16079 pub aux3: f32,
16080 #[doc = "Aux 4, -1 .. 1"]
16081 pub aux4: f32,
16082 #[doc = "System mode."]
16083 pub mode: MavMode,
16084 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16085 pub nav_mode: u8,
16086}
16087impl HIL_CONTROLS_DATA {
16088 pub const ENCODED_LEN: usize = 42usize;
16089 pub const DEFAULT: Self = Self {
16090 time_usec: 0_u64,
16091 roll_ailerons: 0.0_f32,
16092 pitch_elevator: 0.0_f32,
16093 yaw_rudder: 0.0_f32,
16094 throttle: 0.0_f32,
16095 aux1: 0.0_f32,
16096 aux2: 0.0_f32,
16097 aux3: 0.0_f32,
16098 aux4: 0.0_f32,
16099 mode: MavMode::DEFAULT,
16100 nav_mode: 0_u8,
16101 };
16102 #[cfg(feature = "arbitrary")]
16103 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16104 use arbitrary::{Arbitrary, Unstructured};
16105 let mut buf = [0u8; 1024];
16106 rng.fill_bytes(&mut buf);
16107 let mut unstructured = Unstructured::new(&buf);
16108 Self::arbitrary(&mut unstructured).unwrap_or_default()
16109 }
16110}
16111impl Default for HIL_CONTROLS_DATA {
16112 fn default() -> Self {
16113 Self::DEFAULT.clone()
16114 }
16115}
16116impl MessageData for HIL_CONTROLS_DATA {
16117 type Message = MavMessage;
16118 const ID: u32 = 91u32;
16119 const NAME: &'static str = "HIL_CONTROLS";
16120 const EXTRA_CRC: u8 = 63u8;
16121 const ENCODED_LEN: usize = 42usize;
16122 fn deser(
16123 _version: MavlinkVersion,
16124 __input: &[u8],
16125 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16126 let avail_len = __input.len();
16127 let mut payload_buf = [0; Self::ENCODED_LEN];
16128 let mut buf = if avail_len < Self::ENCODED_LEN {
16129 payload_buf[0..avail_len].copy_from_slice(__input);
16130 Bytes::new(&payload_buf)
16131 } else {
16132 Bytes::new(__input)
16133 };
16134 let mut __struct = Self::default();
16135 __struct.time_usec = buf.get_u64_le();
16136 __struct.roll_ailerons = buf.get_f32_le();
16137 __struct.pitch_elevator = buf.get_f32_le();
16138 __struct.yaw_rudder = buf.get_f32_le();
16139 __struct.throttle = buf.get_f32_le();
16140 __struct.aux1 = buf.get_f32_le();
16141 __struct.aux2 = buf.get_f32_le();
16142 __struct.aux3 = buf.get_f32_le();
16143 __struct.aux4 = buf.get_f32_le();
16144 let tmp = buf.get_u8();
16145 __struct.mode =
16146 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16147 enum_type: "MavMode",
16148 value: tmp as u32,
16149 })?;
16150 __struct.nav_mode = buf.get_u8();
16151 Ok(__struct)
16152 }
16153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16154 let mut __tmp = BytesMut::new(bytes);
16155 #[allow(clippy::absurd_extreme_comparisons)]
16156 #[allow(unused_comparisons)]
16157 if __tmp.remaining() < Self::ENCODED_LEN {
16158 panic!(
16159 "buffer is too small (need {} bytes, but got {})",
16160 Self::ENCODED_LEN,
16161 __tmp.remaining(),
16162 )
16163 }
16164 __tmp.put_u64_le(self.time_usec);
16165 __tmp.put_f32_le(self.roll_ailerons);
16166 __tmp.put_f32_le(self.pitch_elevator);
16167 __tmp.put_f32_le(self.yaw_rudder);
16168 __tmp.put_f32_le(self.throttle);
16169 __tmp.put_f32_le(self.aux1);
16170 __tmp.put_f32_le(self.aux2);
16171 __tmp.put_f32_le(self.aux3);
16172 __tmp.put_f32_le(self.aux4);
16173 __tmp.put_u8(self.mode as u8);
16174 __tmp.put_u8(self.nav_mode);
16175 if matches!(version, MavlinkVersion::V2) {
16176 let len = __tmp.len();
16177 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16178 } else {
16179 __tmp.len()
16180 }
16181 }
16182}
16183#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16184#[doc = ""]
16185#[doc = "ID: 113"]
16186#[derive(Debug, Clone, PartialEq)]
16187#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16189#[cfg_attr(feature = "ts", derive(TS))]
16190#[cfg_attr(feature = "ts", ts(export))]
16191pub struct HIL_GPS_DATA {
16192 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16193 pub time_usec: u64,
16194 #[doc = "Latitude (WGS84)"]
16195 pub lat: i32,
16196 #[doc = "Longitude (WGS84)"]
16197 pub lon: i32,
16198 #[doc = "Altitude (MSL). Positive for up."]
16199 pub alt: i32,
16200 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16201 pub eph: u16,
16202 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16203 pub epv: u16,
16204 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16205 pub vel: u16,
16206 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16207 pub vn: i16,
16208 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16209 pub ve: i16,
16210 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16211 pub vd: i16,
16212 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16213 pub cog: u16,
16214 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16215 pub fix_type: u8,
16216 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16217 pub satellites_visible: u8,
16218 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16219 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16220 pub id: u8,
16221 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16222 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16223 pub yaw: u16,
16224}
16225impl HIL_GPS_DATA {
16226 pub const ENCODED_LEN: usize = 39usize;
16227 pub const DEFAULT: Self = Self {
16228 time_usec: 0_u64,
16229 lat: 0_i32,
16230 lon: 0_i32,
16231 alt: 0_i32,
16232 eph: 0_u16,
16233 epv: 0_u16,
16234 vel: 0_u16,
16235 vn: 0_i16,
16236 ve: 0_i16,
16237 vd: 0_i16,
16238 cog: 0_u16,
16239 fix_type: 0_u8,
16240 satellites_visible: 0_u8,
16241 id: 0_u8,
16242 yaw: 0_u16,
16243 };
16244 #[cfg(feature = "arbitrary")]
16245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16246 use arbitrary::{Arbitrary, Unstructured};
16247 let mut buf = [0u8; 1024];
16248 rng.fill_bytes(&mut buf);
16249 let mut unstructured = Unstructured::new(&buf);
16250 Self::arbitrary(&mut unstructured).unwrap_or_default()
16251 }
16252}
16253impl Default for HIL_GPS_DATA {
16254 fn default() -> Self {
16255 Self::DEFAULT.clone()
16256 }
16257}
16258impl MessageData for HIL_GPS_DATA {
16259 type Message = MavMessage;
16260 const ID: u32 = 113u32;
16261 const NAME: &'static str = "HIL_GPS";
16262 const EXTRA_CRC: u8 = 124u8;
16263 const ENCODED_LEN: usize = 39usize;
16264 fn deser(
16265 _version: MavlinkVersion,
16266 __input: &[u8],
16267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16268 let avail_len = __input.len();
16269 let mut payload_buf = [0; Self::ENCODED_LEN];
16270 let mut buf = if avail_len < Self::ENCODED_LEN {
16271 payload_buf[0..avail_len].copy_from_slice(__input);
16272 Bytes::new(&payload_buf)
16273 } else {
16274 Bytes::new(__input)
16275 };
16276 let mut __struct = Self::default();
16277 __struct.time_usec = buf.get_u64_le();
16278 __struct.lat = buf.get_i32_le();
16279 __struct.lon = buf.get_i32_le();
16280 __struct.alt = buf.get_i32_le();
16281 __struct.eph = buf.get_u16_le();
16282 __struct.epv = buf.get_u16_le();
16283 __struct.vel = buf.get_u16_le();
16284 __struct.vn = buf.get_i16_le();
16285 __struct.ve = buf.get_i16_le();
16286 __struct.vd = buf.get_i16_le();
16287 __struct.cog = buf.get_u16_le();
16288 __struct.fix_type = buf.get_u8();
16289 __struct.satellites_visible = buf.get_u8();
16290 __struct.id = buf.get_u8();
16291 __struct.yaw = buf.get_u16_le();
16292 Ok(__struct)
16293 }
16294 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16295 let mut __tmp = BytesMut::new(bytes);
16296 #[allow(clippy::absurd_extreme_comparisons)]
16297 #[allow(unused_comparisons)]
16298 if __tmp.remaining() < Self::ENCODED_LEN {
16299 panic!(
16300 "buffer is too small (need {} bytes, but got {})",
16301 Self::ENCODED_LEN,
16302 __tmp.remaining(),
16303 )
16304 }
16305 __tmp.put_u64_le(self.time_usec);
16306 __tmp.put_i32_le(self.lat);
16307 __tmp.put_i32_le(self.lon);
16308 __tmp.put_i32_le(self.alt);
16309 __tmp.put_u16_le(self.eph);
16310 __tmp.put_u16_le(self.epv);
16311 __tmp.put_u16_le(self.vel);
16312 __tmp.put_i16_le(self.vn);
16313 __tmp.put_i16_le(self.ve);
16314 __tmp.put_i16_le(self.vd);
16315 __tmp.put_u16_le(self.cog);
16316 __tmp.put_u8(self.fix_type);
16317 __tmp.put_u8(self.satellites_visible);
16318 if matches!(version, MavlinkVersion::V2) {
16319 __tmp.put_u8(self.id);
16320 __tmp.put_u16_le(self.yaw);
16321 let len = __tmp.len();
16322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16323 } else {
16324 __tmp.len()
16325 }
16326 }
16327}
16328#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16329#[doc = ""]
16330#[doc = "ID: 114"]
16331#[derive(Debug, Clone, PartialEq)]
16332#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16334#[cfg_attr(feature = "ts", derive(TS))]
16335#[cfg_attr(feature = "ts", ts(export))]
16336pub struct HIL_OPTICAL_FLOW_DATA {
16337 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16338 pub time_usec: u64,
16339 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16340 pub integration_time_us: u32,
16341 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16342 pub integrated_x: f32,
16343 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16344 pub integrated_y: f32,
16345 #[doc = "RH rotation around X axis"]
16346 pub integrated_xgyro: f32,
16347 #[doc = "RH rotation around Y axis"]
16348 pub integrated_ygyro: f32,
16349 #[doc = "RH rotation around Z axis"]
16350 pub integrated_zgyro: f32,
16351 #[doc = "Time since the distance was sampled."]
16352 pub time_delta_distance_us: u32,
16353 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16354 pub distance: f32,
16355 #[doc = "Temperature"]
16356 pub temperature: i16,
16357 #[doc = "Sensor ID"]
16358 pub sensor_id: u8,
16359 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16360 pub quality: u8,
16361}
16362impl HIL_OPTICAL_FLOW_DATA {
16363 pub const ENCODED_LEN: usize = 44usize;
16364 pub const DEFAULT: Self = Self {
16365 time_usec: 0_u64,
16366 integration_time_us: 0_u32,
16367 integrated_x: 0.0_f32,
16368 integrated_y: 0.0_f32,
16369 integrated_xgyro: 0.0_f32,
16370 integrated_ygyro: 0.0_f32,
16371 integrated_zgyro: 0.0_f32,
16372 time_delta_distance_us: 0_u32,
16373 distance: 0.0_f32,
16374 temperature: 0_i16,
16375 sensor_id: 0_u8,
16376 quality: 0_u8,
16377 };
16378 #[cfg(feature = "arbitrary")]
16379 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16380 use arbitrary::{Arbitrary, Unstructured};
16381 let mut buf = [0u8; 1024];
16382 rng.fill_bytes(&mut buf);
16383 let mut unstructured = Unstructured::new(&buf);
16384 Self::arbitrary(&mut unstructured).unwrap_or_default()
16385 }
16386}
16387impl Default for HIL_OPTICAL_FLOW_DATA {
16388 fn default() -> Self {
16389 Self::DEFAULT.clone()
16390 }
16391}
16392impl MessageData for HIL_OPTICAL_FLOW_DATA {
16393 type Message = MavMessage;
16394 const ID: u32 = 114u32;
16395 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16396 const EXTRA_CRC: u8 = 237u8;
16397 const ENCODED_LEN: usize = 44usize;
16398 fn deser(
16399 _version: MavlinkVersion,
16400 __input: &[u8],
16401 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16402 let avail_len = __input.len();
16403 let mut payload_buf = [0; Self::ENCODED_LEN];
16404 let mut buf = if avail_len < Self::ENCODED_LEN {
16405 payload_buf[0..avail_len].copy_from_slice(__input);
16406 Bytes::new(&payload_buf)
16407 } else {
16408 Bytes::new(__input)
16409 };
16410 let mut __struct = Self::default();
16411 __struct.time_usec = buf.get_u64_le();
16412 __struct.integration_time_us = buf.get_u32_le();
16413 __struct.integrated_x = buf.get_f32_le();
16414 __struct.integrated_y = buf.get_f32_le();
16415 __struct.integrated_xgyro = buf.get_f32_le();
16416 __struct.integrated_ygyro = buf.get_f32_le();
16417 __struct.integrated_zgyro = buf.get_f32_le();
16418 __struct.time_delta_distance_us = buf.get_u32_le();
16419 __struct.distance = buf.get_f32_le();
16420 __struct.temperature = buf.get_i16_le();
16421 __struct.sensor_id = buf.get_u8();
16422 __struct.quality = buf.get_u8();
16423 Ok(__struct)
16424 }
16425 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16426 let mut __tmp = BytesMut::new(bytes);
16427 #[allow(clippy::absurd_extreme_comparisons)]
16428 #[allow(unused_comparisons)]
16429 if __tmp.remaining() < Self::ENCODED_LEN {
16430 panic!(
16431 "buffer is too small (need {} bytes, but got {})",
16432 Self::ENCODED_LEN,
16433 __tmp.remaining(),
16434 )
16435 }
16436 __tmp.put_u64_le(self.time_usec);
16437 __tmp.put_u32_le(self.integration_time_us);
16438 __tmp.put_f32_le(self.integrated_x);
16439 __tmp.put_f32_le(self.integrated_y);
16440 __tmp.put_f32_le(self.integrated_xgyro);
16441 __tmp.put_f32_le(self.integrated_ygyro);
16442 __tmp.put_f32_le(self.integrated_zgyro);
16443 __tmp.put_u32_le(self.time_delta_distance_us);
16444 __tmp.put_f32_le(self.distance);
16445 __tmp.put_i16_le(self.temperature);
16446 __tmp.put_u8(self.sensor_id);
16447 __tmp.put_u8(self.quality);
16448 if matches!(version, MavlinkVersion::V2) {
16449 let len = __tmp.len();
16450 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16451 } else {
16452 __tmp.len()
16453 }
16454 }
16455}
16456#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16457#[doc = ""]
16458#[doc = "ID: 92"]
16459#[derive(Debug, Clone, PartialEq)]
16460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16462#[cfg_attr(feature = "ts", derive(TS))]
16463#[cfg_attr(feature = "ts", ts(export))]
16464pub struct HIL_RC_INPUTS_RAW_DATA {
16465 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16466 pub time_usec: u64,
16467 #[doc = "RC channel 1 value"]
16468 pub chan1_raw: u16,
16469 #[doc = "RC channel 2 value"]
16470 pub chan2_raw: u16,
16471 #[doc = "RC channel 3 value"]
16472 pub chan3_raw: u16,
16473 #[doc = "RC channel 4 value"]
16474 pub chan4_raw: u16,
16475 #[doc = "RC channel 5 value"]
16476 pub chan5_raw: u16,
16477 #[doc = "RC channel 6 value"]
16478 pub chan6_raw: u16,
16479 #[doc = "RC channel 7 value"]
16480 pub chan7_raw: u16,
16481 #[doc = "RC channel 8 value"]
16482 pub chan8_raw: u16,
16483 #[doc = "RC channel 9 value"]
16484 pub chan9_raw: u16,
16485 #[doc = "RC channel 10 value"]
16486 pub chan10_raw: u16,
16487 #[doc = "RC channel 11 value"]
16488 pub chan11_raw: u16,
16489 #[doc = "RC channel 12 value"]
16490 pub chan12_raw: u16,
16491 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16492 pub rssi: u8,
16493}
16494impl HIL_RC_INPUTS_RAW_DATA {
16495 pub const ENCODED_LEN: usize = 33usize;
16496 pub const DEFAULT: Self = Self {
16497 time_usec: 0_u64,
16498 chan1_raw: 0_u16,
16499 chan2_raw: 0_u16,
16500 chan3_raw: 0_u16,
16501 chan4_raw: 0_u16,
16502 chan5_raw: 0_u16,
16503 chan6_raw: 0_u16,
16504 chan7_raw: 0_u16,
16505 chan8_raw: 0_u16,
16506 chan9_raw: 0_u16,
16507 chan10_raw: 0_u16,
16508 chan11_raw: 0_u16,
16509 chan12_raw: 0_u16,
16510 rssi: 0_u8,
16511 };
16512 #[cfg(feature = "arbitrary")]
16513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16514 use arbitrary::{Arbitrary, Unstructured};
16515 let mut buf = [0u8; 1024];
16516 rng.fill_bytes(&mut buf);
16517 let mut unstructured = Unstructured::new(&buf);
16518 Self::arbitrary(&mut unstructured).unwrap_or_default()
16519 }
16520}
16521impl Default for HIL_RC_INPUTS_RAW_DATA {
16522 fn default() -> Self {
16523 Self::DEFAULT.clone()
16524 }
16525}
16526impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16527 type Message = MavMessage;
16528 const ID: u32 = 92u32;
16529 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16530 const EXTRA_CRC: u8 = 54u8;
16531 const ENCODED_LEN: usize = 33usize;
16532 fn deser(
16533 _version: MavlinkVersion,
16534 __input: &[u8],
16535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16536 let avail_len = __input.len();
16537 let mut payload_buf = [0; Self::ENCODED_LEN];
16538 let mut buf = if avail_len < Self::ENCODED_LEN {
16539 payload_buf[0..avail_len].copy_from_slice(__input);
16540 Bytes::new(&payload_buf)
16541 } else {
16542 Bytes::new(__input)
16543 };
16544 let mut __struct = Self::default();
16545 __struct.time_usec = buf.get_u64_le();
16546 __struct.chan1_raw = buf.get_u16_le();
16547 __struct.chan2_raw = buf.get_u16_le();
16548 __struct.chan3_raw = buf.get_u16_le();
16549 __struct.chan4_raw = buf.get_u16_le();
16550 __struct.chan5_raw = buf.get_u16_le();
16551 __struct.chan6_raw = buf.get_u16_le();
16552 __struct.chan7_raw = buf.get_u16_le();
16553 __struct.chan8_raw = buf.get_u16_le();
16554 __struct.chan9_raw = buf.get_u16_le();
16555 __struct.chan10_raw = buf.get_u16_le();
16556 __struct.chan11_raw = buf.get_u16_le();
16557 __struct.chan12_raw = buf.get_u16_le();
16558 __struct.rssi = buf.get_u8();
16559 Ok(__struct)
16560 }
16561 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16562 let mut __tmp = BytesMut::new(bytes);
16563 #[allow(clippy::absurd_extreme_comparisons)]
16564 #[allow(unused_comparisons)]
16565 if __tmp.remaining() < Self::ENCODED_LEN {
16566 panic!(
16567 "buffer is too small (need {} bytes, but got {})",
16568 Self::ENCODED_LEN,
16569 __tmp.remaining(),
16570 )
16571 }
16572 __tmp.put_u64_le(self.time_usec);
16573 __tmp.put_u16_le(self.chan1_raw);
16574 __tmp.put_u16_le(self.chan2_raw);
16575 __tmp.put_u16_le(self.chan3_raw);
16576 __tmp.put_u16_le(self.chan4_raw);
16577 __tmp.put_u16_le(self.chan5_raw);
16578 __tmp.put_u16_le(self.chan6_raw);
16579 __tmp.put_u16_le(self.chan7_raw);
16580 __tmp.put_u16_le(self.chan8_raw);
16581 __tmp.put_u16_le(self.chan9_raw);
16582 __tmp.put_u16_le(self.chan10_raw);
16583 __tmp.put_u16_le(self.chan11_raw);
16584 __tmp.put_u16_le(self.chan12_raw);
16585 __tmp.put_u8(self.rssi);
16586 if matches!(version, MavlinkVersion::V2) {
16587 let len = __tmp.len();
16588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16589 } else {
16590 __tmp.len()
16591 }
16592 }
16593}
16594#[doc = "The IMU readings in SI units in NED body frame."]
16595#[doc = ""]
16596#[doc = "ID: 107"]
16597#[derive(Debug, Clone, PartialEq)]
16598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16600#[cfg_attr(feature = "ts", derive(TS))]
16601#[cfg_attr(feature = "ts", ts(export))]
16602pub struct HIL_SENSOR_DATA {
16603 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16604 pub time_usec: u64,
16605 #[doc = "X acceleration"]
16606 pub xacc: f32,
16607 #[doc = "Y acceleration"]
16608 pub yacc: f32,
16609 #[doc = "Z acceleration"]
16610 pub zacc: f32,
16611 #[doc = "Angular speed around X axis in body frame"]
16612 pub xgyro: f32,
16613 #[doc = "Angular speed around Y axis in body frame"]
16614 pub ygyro: f32,
16615 #[doc = "Angular speed around Z axis in body frame"]
16616 pub zgyro: f32,
16617 #[doc = "X Magnetic field"]
16618 pub xmag: f32,
16619 #[doc = "Y Magnetic field"]
16620 pub ymag: f32,
16621 #[doc = "Z Magnetic field"]
16622 pub zmag: f32,
16623 #[doc = "Absolute pressure"]
16624 pub abs_pressure: f32,
16625 #[doc = "Differential pressure (airspeed)"]
16626 pub diff_pressure: f32,
16627 #[doc = "Altitude calculated from pressure"]
16628 pub pressure_alt: f32,
16629 #[doc = "Temperature"]
16630 pub temperature: f32,
16631 #[doc = "Bitmap for fields that have updated since last message"]
16632 pub fields_updated: HilSensorUpdatedFlags,
16633 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16634 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16635 pub id: u8,
16636}
16637impl HIL_SENSOR_DATA {
16638 pub const ENCODED_LEN: usize = 65usize;
16639 pub const DEFAULT: Self = Self {
16640 time_usec: 0_u64,
16641 xacc: 0.0_f32,
16642 yacc: 0.0_f32,
16643 zacc: 0.0_f32,
16644 xgyro: 0.0_f32,
16645 ygyro: 0.0_f32,
16646 zgyro: 0.0_f32,
16647 xmag: 0.0_f32,
16648 ymag: 0.0_f32,
16649 zmag: 0.0_f32,
16650 abs_pressure: 0.0_f32,
16651 diff_pressure: 0.0_f32,
16652 pressure_alt: 0.0_f32,
16653 temperature: 0.0_f32,
16654 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16655 id: 0_u8,
16656 };
16657 #[cfg(feature = "arbitrary")]
16658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16659 use arbitrary::{Arbitrary, Unstructured};
16660 let mut buf = [0u8; 1024];
16661 rng.fill_bytes(&mut buf);
16662 let mut unstructured = Unstructured::new(&buf);
16663 Self::arbitrary(&mut unstructured).unwrap_or_default()
16664 }
16665}
16666impl Default for HIL_SENSOR_DATA {
16667 fn default() -> Self {
16668 Self::DEFAULT.clone()
16669 }
16670}
16671impl MessageData for HIL_SENSOR_DATA {
16672 type Message = MavMessage;
16673 const ID: u32 = 107u32;
16674 const NAME: &'static str = "HIL_SENSOR";
16675 const EXTRA_CRC: u8 = 108u8;
16676 const ENCODED_LEN: usize = 65usize;
16677 fn deser(
16678 _version: MavlinkVersion,
16679 __input: &[u8],
16680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16681 let avail_len = __input.len();
16682 let mut payload_buf = [0; Self::ENCODED_LEN];
16683 let mut buf = if avail_len < Self::ENCODED_LEN {
16684 payload_buf[0..avail_len].copy_from_slice(__input);
16685 Bytes::new(&payload_buf)
16686 } else {
16687 Bytes::new(__input)
16688 };
16689 let mut __struct = Self::default();
16690 __struct.time_usec = buf.get_u64_le();
16691 __struct.xacc = buf.get_f32_le();
16692 __struct.yacc = buf.get_f32_le();
16693 __struct.zacc = buf.get_f32_le();
16694 __struct.xgyro = buf.get_f32_le();
16695 __struct.ygyro = buf.get_f32_le();
16696 __struct.zgyro = buf.get_f32_le();
16697 __struct.xmag = buf.get_f32_le();
16698 __struct.ymag = buf.get_f32_le();
16699 __struct.zmag = buf.get_f32_le();
16700 __struct.abs_pressure = buf.get_f32_le();
16701 __struct.diff_pressure = buf.get_f32_le();
16702 __struct.pressure_alt = buf.get_f32_le();
16703 __struct.temperature = buf.get_f32_le();
16704 let tmp = buf.get_u32_le();
16705 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16706 tmp & HilSensorUpdatedFlags::all().bits(),
16707 )
16708 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16709 flag_type: "HilSensorUpdatedFlags",
16710 value: tmp as u32,
16711 })?;
16712 __struct.id = buf.get_u8();
16713 Ok(__struct)
16714 }
16715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16716 let mut __tmp = BytesMut::new(bytes);
16717 #[allow(clippy::absurd_extreme_comparisons)]
16718 #[allow(unused_comparisons)]
16719 if __tmp.remaining() < Self::ENCODED_LEN {
16720 panic!(
16721 "buffer is too small (need {} bytes, but got {})",
16722 Self::ENCODED_LEN,
16723 __tmp.remaining(),
16724 )
16725 }
16726 __tmp.put_u64_le(self.time_usec);
16727 __tmp.put_f32_le(self.xacc);
16728 __tmp.put_f32_le(self.yacc);
16729 __tmp.put_f32_le(self.zacc);
16730 __tmp.put_f32_le(self.xgyro);
16731 __tmp.put_f32_le(self.ygyro);
16732 __tmp.put_f32_le(self.zgyro);
16733 __tmp.put_f32_le(self.xmag);
16734 __tmp.put_f32_le(self.ymag);
16735 __tmp.put_f32_le(self.zmag);
16736 __tmp.put_f32_le(self.abs_pressure);
16737 __tmp.put_f32_le(self.diff_pressure);
16738 __tmp.put_f32_le(self.pressure_alt);
16739 __tmp.put_f32_le(self.temperature);
16740 __tmp.put_u32_le(self.fields_updated.bits());
16741 if matches!(version, MavlinkVersion::V2) {
16742 __tmp.put_u8(self.id);
16743 let len = __tmp.len();
16744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16745 } else {
16746 __tmp.len()
16747 }
16748 }
16749}
16750#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16751#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16752#[doc = ""]
16753#[doc = "ID: 90"]
16754#[derive(Debug, Clone, PartialEq)]
16755#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16756#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16757#[cfg_attr(feature = "ts", derive(TS))]
16758#[cfg_attr(feature = "ts", ts(export))]
16759pub struct HIL_STATE_DATA {
16760 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16761 pub time_usec: u64,
16762 #[doc = "Roll angle"]
16763 pub roll: f32,
16764 #[doc = "Pitch angle"]
16765 pub pitch: f32,
16766 #[doc = "Yaw angle"]
16767 pub yaw: f32,
16768 #[doc = "Body frame roll / phi angular speed"]
16769 pub rollspeed: f32,
16770 #[doc = "Body frame pitch / theta angular speed"]
16771 pub pitchspeed: f32,
16772 #[doc = "Body frame yaw / psi angular speed"]
16773 pub yawspeed: f32,
16774 #[doc = "Latitude"]
16775 pub lat: i32,
16776 #[doc = "Longitude"]
16777 pub lon: i32,
16778 #[doc = "Altitude"]
16779 pub alt: i32,
16780 #[doc = "Ground X Speed (Latitude)"]
16781 pub vx: i16,
16782 #[doc = "Ground Y Speed (Longitude)"]
16783 pub vy: i16,
16784 #[doc = "Ground Z Speed (Altitude)"]
16785 pub vz: i16,
16786 #[doc = "X acceleration"]
16787 pub xacc: i16,
16788 #[doc = "Y acceleration"]
16789 pub yacc: i16,
16790 #[doc = "Z acceleration"]
16791 pub zacc: i16,
16792}
16793impl HIL_STATE_DATA {
16794 pub const ENCODED_LEN: usize = 56usize;
16795 pub const DEFAULT: Self = Self {
16796 time_usec: 0_u64,
16797 roll: 0.0_f32,
16798 pitch: 0.0_f32,
16799 yaw: 0.0_f32,
16800 rollspeed: 0.0_f32,
16801 pitchspeed: 0.0_f32,
16802 yawspeed: 0.0_f32,
16803 lat: 0_i32,
16804 lon: 0_i32,
16805 alt: 0_i32,
16806 vx: 0_i16,
16807 vy: 0_i16,
16808 vz: 0_i16,
16809 xacc: 0_i16,
16810 yacc: 0_i16,
16811 zacc: 0_i16,
16812 };
16813 #[cfg(feature = "arbitrary")]
16814 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16815 use arbitrary::{Arbitrary, Unstructured};
16816 let mut buf = [0u8; 1024];
16817 rng.fill_bytes(&mut buf);
16818 let mut unstructured = Unstructured::new(&buf);
16819 Self::arbitrary(&mut unstructured).unwrap_or_default()
16820 }
16821}
16822impl Default for HIL_STATE_DATA {
16823 fn default() -> Self {
16824 Self::DEFAULT.clone()
16825 }
16826}
16827impl MessageData for HIL_STATE_DATA {
16828 type Message = MavMessage;
16829 const ID: u32 = 90u32;
16830 const NAME: &'static str = "HIL_STATE";
16831 const EXTRA_CRC: u8 = 183u8;
16832 const ENCODED_LEN: usize = 56usize;
16833 fn deser(
16834 _version: MavlinkVersion,
16835 __input: &[u8],
16836 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16837 let avail_len = __input.len();
16838 let mut payload_buf = [0; Self::ENCODED_LEN];
16839 let mut buf = if avail_len < Self::ENCODED_LEN {
16840 payload_buf[0..avail_len].copy_from_slice(__input);
16841 Bytes::new(&payload_buf)
16842 } else {
16843 Bytes::new(__input)
16844 };
16845 let mut __struct = Self::default();
16846 __struct.time_usec = buf.get_u64_le();
16847 __struct.roll = buf.get_f32_le();
16848 __struct.pitch = buf.get_f32_le();
16849 __struct.yaw = buf.get_f32_le();
16850 __struct.rollspeed = buf.get_f32_le();
16851 __struct.pitchspeed = buf.get_f32_le();
16852 __struct.yawspeed = buf.get_f32_le();
16853 __struct.lat = buf.get_i32_le();
16854 __struct.lon = buf.get_i32_le();
16855 __struct.alt = buf.get_i32_le();
16856 __struct.vx = buf.get_i16_le();
16857 __struct.vy = buf.get_i16_le();
16858 __struct.vz = buf.get_i16_le();
16859 __struct.xacc = buf.get_i16_le();
16860 __struct.yacc = buf.get_i16_le();
16861 __struct.zacc = buf.get_i16_le();
16862 Ok(__struct)
16863 }
16864 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16865 let mut __tmp = BytesMut::new(bytes);
16866 #[allow(clippy::absurd_extreme_comparisons)]
16867 #[allow(unused_comparisons)]
16868 if __tmp.remaining() < Self::ENCODED_LEN {
16869 panic!(
16870 "buffer is too small (need {} bytes, but got {})",
16871 Self::ENCODED_LEN,
16872 __tmp.remaining(),
16873 )
16874 }
16875 __tmp.put_u64_le(self.time_usec);
16876 __tmp.put_f32_le(self.roll);
16877 __tmp.put_f32_le(self.pitch);
16878 __tmp.put_f32_le(self.yaw);
16879 __tmp.put_f32_le(self.rollspeed);
16880 __tmp.put_f32_le(self.pitchspeed);
16881 __tmp.put_f32_le(self.yawspeed);
16882 __tmp.put_i32_le(self.lat);
16883 __tmp.put_i32_le(self.lon);
16884 __tmp.put_i32_le(self.alt);
16885 __tmp.put_i16_le(self.vx);
16886 __tmp.put_i16_le(self.vy);
16887 __tmp.put_i16_le(self.vz);
16888 __tmp.put_i16_le(self.xacc);
16889 __tmp.put_i16_le(self.yacc);
16890 __tmp.put_i16_le(self.zacc);
16891 if matches!(version, MavlinkVersion::V2) {
16892 let len = __tmp.len();
16893 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16894 } else {
16895 __tmp.len()
16896 }
16897 }
16898}
16899#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16900#[doc = ""]
16901#[doc = "ID: 115"]
16902#[derive(Debug, Clone, PartialEq)]
16903#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16904#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16905#[cfg_attr(feature = "ts", derive(TS))]
16906#[cfg_attr(feature = "ts", ts(export))]
16907pub struct HIL_STATE_QUATERNION_DATA {
16908 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16909 pub time_usec: u64,
16910 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16911 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16912 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16913 pub attitude_quaternion: [f32; 4],
16914 #[doc = "Body frame roll / phi angular speed"]
16915 pub rollspeed: f32,
16916 #[doc = "Body frame pitch / theta angular speed"]
16917 pub pitchspeed: f32,
16918 #[doc = "Body frame yaw / psi angular speed"]
16919 pub yawspeed: f32,
16920 #[doc = "Latitude"]
16921 pub lat: i32,
16922 #[doc = "Longitude"]
16923 pub lon: i32,
16924 #[doc = "Altitude"]
16925 pub alt: i32,
16926 #[doc = "Ground X Speed (Latitude)"]
16927 pub vx: i16,
16928 #[doc = "Ground Y Speed (Longitude)"]
16929 pub vy: i16,
16930 #[doc = "Ground Z Speed (Altitude)"]
16931 pub vz: i16,
16932 #[doc = "Indicated airspeed"]
16933 pub ind_airspeed: u16,
16934 #[doc = "True airspeed"]
16935 pub true_airspeed: u16,
16936 #[doc = "X acceleration"]
16937 pub xacc: i16,
16938 #[doc = "Y acceleration"]
16939 pub yacc: i16,
16940 #[doc = "Z acceleration"]
16941 pub zacc: i16,
16942}
16943impl HIL_STATE_QUATERNION_DATA {
16944 pub const ENCODED_LEN: usize = 64usize;
16945 pub const DEFAULT: Self = Self {
16946 time_usec: 0_u64,
16947 attitude_quaternion: [0.0_f32; 4usize],
16948 rollspeed: 0.0_f32,
16949 pitchspeed: 0.0_f32,
16950 yawspeed: 0.0_f32,
16951 lat: 0_i32,
16952 lon: 0_i32,
16953 alt: 0_i32,
16954 vx: 0_i16,
16955 vy: 0_i16,
16956 vz: 0_i16,
16957 ind_airspeed: 0_u16,
16958 true_airspeed: 0_u16,
16959 xacc: 0_i16,
16960 yacc: 0_i16,
16961 zacc: 0_i16,
16962 };
16963 #[cfg(feature = "arbitrary")]
16964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16965 use arbitrary::{Arbitrary, Unstructured};
16966 let mut buf = [0u8; 1024];
16967 rng.fill_bytes(&mut buf);
16968 let mut unstructured = Unstructured::new(&buf);
16969 Self::arbitrary(&mut unstructured).unwrap_or_default()
16970 }
16971}
16972impl Default for HIL_STATE_QUATERNION_DATA {
16973 fn default() -> Self {
16974 Self::DEFAULT.clone()
16975 }
16976}
16977impl MessageData for HIL_STATE_QUATERNION_DATA {
16978 type Message = MavMessage;
16979 const ID: u32 = 115u32;
16980 const NAME: &'static str = "HIL_STATE_QUATERNION";
16981 const EXTRA_CRC: u8 = 4u8;
16982 const ENCODED_LEN: usize = 64usize;
16983 fn deser(
16984 _version: MavlinkVersion,
16985 __input: &[u8],
16986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16987 let avail_len = __input.len();
16988 let mut payload_buf = [0; Self::ENCODED_LEN];
16989 let mut buf = if avail_len < Self::ENCODED_LEN {
16990 payload_buf[0..avail_len].copy_from_slice(__input);
16991 Bytes::new(&payload_buf)
16992 } else {
16993 Bytes::new(__input)
16994 };
16995 let mut __struct = Self::default();
16996 __struct.time_usec = buf.get_u64_le();
16997 for v in &mut __struct.attitude_quaternion {
16998 let val = buf.get_f32_le();
16999 *v = val;
17000 }
17001 __struct.rollspeed = buf.get_f32_le();
17002 __struct.pitchspeed = buf.get_f32_le();
17003 __struct.yawspeed = buf.get_f32_le();
17004 __struct.lat = buf.get_i32_le();
17005 __struct.lon = buf.get_i32_le();
17006 __struct.alt = buf.get_i32_le();
17007 __struct.vx = buf.get_i16_le();
17008 __struct.vy = buf.get_i16_le();
17009 __struct.vz = buf.get_i16_le();
17010 __struct.ind_airspeed = buf.get_u16_le();
17011 __struct.true_airspeed = buf.get_u16_le();
17012 __struct.xacc = buf.get_i16_le();
17013 __struct.yacc = buf.get_i16_le();
17014 __struct.zacc = buf.get_i16_le();
17015 Ok(__struct)
17016 }
17017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17018 let mut __tmp = BytesMut::new(bytes);
17019 #[allow(clippy::absurd_extreme_comparisons)]
17020 #[allow(unused_comparisons)]
17021 if __tmp.remaining() < Self::ENCODED_LEN {
17022 panic!(
17023 "buffer is too small (need {} bytes, but got {})",
17024 Self::ENCODED_LEN,
17025 __tmp.remaining(),
17026 )
17027 }
17028 __tmp.put_u64_le(self.time_usec);
17029 for val in &self.attitude_quaternion {
17030 __tmp.put_f32_le(*val);
17031 }
17032 __tmp.put_f32_le(self.rollspeed);
17033 __tmp.put_f32_le(self.pitchspeed);
17034 __tmp.put_f32_le(self.yawspeed);
17035 __tmp.put_i32_le(self.lat);
17036 __tmp.put_i32_le(self.lon);
17037 __tmp.put_i32_le(self.alt);
17038 __tmp.put_i16_le(self.vx);
17039 __tmp.put_i16_le(self.vy);
17040 __tmp.put_i16_le(self.vz);
17041 __tmp.put_u16_le(self.ind_airspeed);
17042 __tmp.put_u16_le(self.true_airspeed);
17043 __tmp.put_i16_le(self.xacc);
17044 __tmp.put_i16_le(self.yacc);
17045 __tmp.put_i16_le(self.zacc);
17046 if matches!(version, MavlinkVersion::V2) {
17047 let len = __tmp.len();
17048 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17049 } else {
17050 __tmp.len()
17051 }
17052 }
17053}
17054#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17055#[doc = ""]
17056#[doc = "ID: 242"]
17057#[derive(Debug, Clone, PartialEq)]
17058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17060#[cfg_attr(feature = "ts", derive(TS))]
17061#[cfg_attr(feature = "ts", ts(export))]
17062pub struct HOME_POSITION_DATA {
17063 #[doc = "Latitude (WGS84)"]
17064 pub latitude: i32,
17065 #[doc = "Longitude (WGS84)"]
17066 pub longitude: i32,
17067 #[doc = "Altitude (MSL). Positive for up."]
17068 pub altitude: i32,
17069 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17070 pub x: f32,
17071 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17072 pub y: f32,
17073 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17074 pub z: f32,
17075 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17076 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17077 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17078 pub q: [f32; 4],
17079 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17080 pub approach_x: f32,
17081 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17082 pub approach_y: f32,
17083 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17084 pub approach_z: f32,
17085 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17086 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17087 pub time_usec: u64,
17088}
17089impl HOME_POSITION_DATA {
17090 pub const ENCODED_LEN: usize = 60usize;
17091 pub const DEFAULT: Self = Self {
17092 latitude: 0_i32,
17093 longitude: 0_i32,
17094 altitude: 0_i32,
17095 x: 0.0_f32,
17096 y: 0.0_f32,
17097 z: 0.0_f32,
17098 q: [0.0_f32; 4usize],
17099 approach_x: 0.0_f32,
17100 approach_y: 0.0_f32,
17101 approach_z: 0.0_f32,
17102 time_usec: 0_u64,
17103 };
17104 #[cfg(feature = "arbitrary")]
17105 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17106 use arbitrary::{Arbitrary, Unstructured};
17107 let mut buf = [0u8; 1024];
17108 rng.fill_bytes(&mut buf);
17109 let mut unstructured = Unstructured::new(&buf);
17110 Self::arbitrary(&mut unstructured).unwrap_or_default()
17111 }
17112}
17113impl Default for HOME_POSITION_DATA {
17114 fn default() -> Self {
17115 Self::DEFAULT.clone()
17116 }
17117}
17118impl MessageData for HOME_POSITION_DATA {
17119 type Message = MavMessage;
17120 const ID: u32 = 242u32;
17121 const NAME: &'static str = "HOME_POSITION";
17122 const EXTRA_CRC: u8 = 104u8;
17123 const ENCODED_LEN: usize = 60usize;
17124 fn deser(
17125 _version: MavlinkVersion,
17126 __input: &[u8],
17127 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17128 let avail_len = __input.len();
17129 let mut payload_buf = [0; Self::ENCODED_LEN];
17130 let mut buf = if avail_len < Self::ENCODED_LEN {
17131 payload_buf[0..avail_len].copy_from_slice(__input);
17132 Bytes::new(&payload_buf)
17133 } else {
17134 Bytes::new(__input)
17135 };
17136 let mut __struct = Self::default();
17137 __struct.latitude = buf.get_i32_le();
17138 __struct.longitude = buf.get_i32_le();
17139 __struct.altitude = buf.get_i32_le();
17140 __struct.x = buf.get_f32_le();
17141 __struct.y = buf.get_f32_le();
17142 __struct.z = buf.get_f32_le();
17143 for v in &mut __struct.q {
17144 let val = buf.get_f32_le();
17145 *v = val;
17146 }
17147 __struct.approach_x = buf.get_f32_le();
17148 __struct.approach_y = buf.get_f32_le();
17149 __struct.approach_z = buf.get_f32_le();
17150 __struct.time_usec = buf.get_u64_le();
17151 Ok(__struct)
17152 }
17153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17154 let mut __tmp = BytesMut::new(bytes);
17155 #[allow(clippy::absurd_extreme_comparisons)]
17156 #[allow(unused_comparisons)]
17157 if __tmp.remaining() < Self::ENCODED_LEN {
17158 panic!(
17159 "buffer is too small (need {} bytes, but got {})",
17160 Self::ENCODED_LEN,
17161 __tmp.remaining(),
17162 )
17163 }
17164 __tmp.put_i32_le(self.latitude);
17165 __tmp.put_i32_le(self.longitude);
17166 __tmp.put_i32_le(self.altitude);
17167 __tmp.put_f32_le(self.x);
17168 __tmp.put_f32_le(self.y);
17169 __tmp.put_f32_le(self.z);
17170 for val in &self.q {
17171 __tmp.put_f32_le(*val);
17172 }
17173 __tmp.put_f32_le(self.approach_x);
17174 __tmp.put_f32_le(self.approach_y);
17175 __tmp.put_f32_le(self.approach_z);
17176 if matches!(version, MavlinkVersion::V2) {
17177 __tmp.put_u64_le(self.time_usec);
17178 let len = __tmp.len();
17179 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17180 } else {
17181 __tmp.len()
17182 }
17183 }
17184}
17185#[doc = "Temperature and humidity from hygrometer."]
17186#[doc = ""]
17187#[doc = "ID: 12920"]
17188#[derive(Debug, Clone, PartialEq)]
17189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17190#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17191#[cfg_attr(feature = "ts", derive(TS))]
17192#[cfg_attr(feature = "ts", ts(export))]
17193pub struct HYGROMETER_SENSOR_DATA {
17194 #[doc = "Temperature"]
17195 pub temperature: i16,
17196 #[doc = "Humidity"]
17197 pub humidity: u16,
17198 #[doc = "Hygrometer ID"]
17199 pub id: u8,
17200}
17201impl HYGROMETER_SENSOR_DATA {
17202 pub const ENCODED_LEN: usize = 5usize;
17203 pub const DEFAULT: Self = Self {
17204 temperature: 0_i16,
17205 humidity: 0_u16,
17206 id: 0_u8,
17207 };
17208 #[cfg(feature = "arbitrary")]
17209 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17210 use arbitrary::{Arbitrary, Unstructured};
17211 let mut buf = [0u8; 1024];
17212 rng.fill_bytes(&mut buf);
17213 let mut unstructured = Unstructured::new(&buf);
17214 Self::arbitrary(&mut unstructured).unwrap_or_default()
17215 }
17216}
17217impl Default for HYGROMETER_SENSOR_DATA {
17218 fn default() -> Self {
17219 Self::DEFAULT.clone()
17220 }
17221}
17222impl MessageData for HYGROMETER_SENSOR_DATA {
17223 type Message = MavMessage;
17224 const ID: u32 = 12920u32;
17225 const NAME: &'static str = "HYGROMETER_SENSOR";
17226 const EXTRA_CRC: u8 = 20u8;
17227 const ENCODED_LEN: usize = 5usize;
17228 fn deser(
17229 _version: MavlinkVersion,
17230 __input: &[u8],
17231 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17232 let avail_len = __input.len();
17233 let mut payload_buf = [0; Self::ENCODED_LEN];
17234 let mut buf = if avail_len < Self::ENCODED_LEN {
17235 payload_buf[0..avail_len].copy_from_slice(__input);
17236 Bytes::new(&payload_buf)
17237 } else {
17238 Bytes::new(__input)
17239 };
17240 let mut __struct = Self::default();
17241 __struct.temperature = buf.get_i16_le();
17242 __struct.humidity = buf.get_u16_le();
17243 __struct.id = buf.get_u8();
17244 Ok(__struct)
17245 }
17246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17247 let mut __tmp = BytesMut::new(bytes);
17248 #[allow(clippy::absurd_extreme_comparisons)]
17249 #[allow(unused_comparisons)]
17250 if __tmp.remaining() < Self::ENCODED_LEN {
17251 panic!(
17252 "buffer is too small (need {} bytes, but got {})",
17253 Self::ENCODED_LEN,
17254 __tmp.remaining(),
17255 )
17256 }
17257 __tmp.put_i16_le(self.temperature);
17258 __tmp.put_u16_le(self.humidity);
17259 __tmp.put_u8(self.id);
17260 if matches!(version, MavlinkVersion::V2) {
17261 let len = __tmp.len();
17262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17263 } else {
17264 __tmp.len()
17265 }
17266 }
17267}
17268#[doc = "Illuminator status."]
17269#[doc = ""]
17270#[doc = "ID: 440"]
17271#[derive(Debug, Clone, PartialEq)]
17272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17274#[cfg_attr(feature = "ts", derive(TS))]
17275#[cfg_attr(feature = "ts", ts(export))]
17276pub struct ILLUMINATOR_STATUS_DATA {
17277 #[doc = "Time since the start-up of the illuminator in ms"]
17278 pub uptime_ms: u32,
17279 #[doc = "Errors"]
17280 pub error_status: IlluminatorErrorFlags,
17281 #[doc = "Illuminator brightness"]
17282 pub brightness: f32,
17283 #[doc = "Illuminator strobing period in seconds"]
17284 pub strobe_period: f32,
17285 #[doc = "Illuminator strobing duty cycle"]
17286 pub strobe_duty_cycle: f32,
17287 #[doc = "Temperature in Celsius"]
17288 pub temp_c: f32,
17289 #[doc = "Minimum strobing period in seconds"]
17290 pub min_strobe_period: f32,
17291 #[doc = "Maximum strobing period in seconds"]
17292 pub max_strobe_period: f32,
17293 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17294 pub enable: u8,
17295 #[doc = "Supported illuminator modes"]
17296 pub mode_bitmask: IlluminatorMode,
17297 #[doc = "Illuminator mode"]
17298 pub mode: IlluminatorMode,
17299}
17300impl ILLUMINATOR_STATUS_DATA {
17301 pub const ENCODED_LEN: usize = 35usize;
17302 pub const DEFAULT: Self = Self {
17303 uptime_ms: 0_u32,
17304 error_status: IlluminatorErrorFlags::DEFAULT,
17305 brightness: 0.0_f32,
17306 strobe_period: 0.0_f32,
17307 strobe_duty_cycle: 0.0_f32,
17308 temp_c: 0.0_f32,
17309 min_strobe_period: 0.0_f32,
17310 max_strobe_period: 0.0_f32,
17311 enable: 0_u8,
17312 mode_bitmask: IlluminatorMode::DEFAULT,
17313 mode: IlluminatorMode::DEFAULT,
17314 };
17315 #[cfg(feature = "arbitrary")]
17316 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17317 use arbitrary::{Arbitrary, Unstructured};
17318 let mut buf = [0u8; 1024];
17319 rng.fill_bytes(&mut buf);
17320 let mut unstructured = Unstructured::new(&buf);
17321 Self::arbitrary(&mut unstructured).unwrap_or_default()
17322 }
17323}
17324impl Default for ILLUMINATOR_STATUS_DATA {
17325 fn default() -> Self {
17326 Self::DEFAULT.clone()
17327 }
17328}
17329impl MessageData for ILLUMINATOR_STATUS_DATA {
17330 type Message = MavMessage;
17331 const ID: u32 = 440u32;
17332 const NAME: &'static str = "ILLUMINATOR_STATUS";
17333 const EXTRA_CRC: u8 = 66u8;
17334 const ENCODED_LEN: usize = 35usize;
17335 fn deser(
17336 _version: MavlinkVersion,
17337 __input: &[u8],
17338 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17339 let avail_len = __input.len();
17340 let mut payload_buf = [0; Self::ENCODED_LEN];
17341 let mut buf = if avail_len < Self::ENCODED_LEN {
17342 payload_buf[0..avail_len].copy_from_slice(__input);
17343 Bytes::new(&payload_buf)
17344 } else {
17345 Bytes::new(__input)
17346 };
17347 let mut __struct = Self::default();
17348 __struct.uptime_ms = buf.get_u32_le();
17349 let tmp = buf.get_u32_le();
17350 __struct.error_status = IlluminatorErrorFlags::from_bits(
17351 tmp & IlluminatorErrorFlags::all().bits(),
17352 )
17353 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17354 flag_type: "IlluminatorErrorFlags",
17355 value: tmp as u32,
17356 })?;
17357 __struct.brightness = buf.get_f32_le();
17358 __struct.strobe_period = buf.get_f32_le();
17359 __struct.strobe_duty_cycle = buf.get_f32_le();
17360 __struct.temp_c = buf.get_f32_le();
17361 __struct.min_strobe_period = buf.get_f32_le();
17362 __struct.max_strobe_period = buf.get_f32_le();
17363 __struct.enable = buf.get_u8();
17364 let tmp = buf.get_u8();
17365 __struct.mode_bitmask =
17366 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17367 enum_type: "IlluminatorMode",
17368 value: tmp as u32,
17369 })?;
17370 let tmp = buf.get_u8();
17371 __struct.mode =
17372 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17373 enum_type: "IlluminatorMode",
17374 value: tmp as u32,
17375 })?;
17376 Ok(__struct)
17377 }
17378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17379 let mut __tmp = BytesMut::new(bytes);
17380 #[allow(clippy::absurd_extreme_comparisons)]
17381 #[allow(unused_comparisons)]
17382 if __tmp.remaining() < Self::ENCODED_LEN {
17383 panic!(
17384 "buffer is too small (need {} bytes, but got {})",
17385 Self::ENCODED_LEN,
17386 __tmp.remaining(),
17387 )
17388 }
17389 __tmp.put_u32_le(self.uptime_ms);
17390 __tmp.put_u32_le(self.error_status.bits());
17391 __tmp.put_f32_le(self.brightness);
17392 __tmp.put_f32_le(self.strobe_period);
17393 __tmp.put_f32_le(self.strobe_duty_cycle);
17394 __tmp.put_f32_le(self.temp_c);
17395 __tmp.put_f32_le(self.min_strobe_period);
17396 __tmp.put_f32_le(self.max_strobe_period);
17397 __tmp.put_u8(self.enable);
17398 __tmp.put_u8(self.mode_bitmask as u8);
17399 __tmp.put_u8(self.mode as u8);
17400 if matches!(version, MavlinkVersion::V2) {
17401 let len = __tmp.len();
17402 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17403 } else {
17404 __tmp.len()
17405 }
17406 }
17407}
17408#[doc = "Status of the Iridium SBD link."]
17409#[doc = ""]
17410#[doc = "ID: 335"]
17411#[derive(Debug, Clone, PartialEq)]
17412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17413#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17414#[cfg_attr(feature = "ts", derive(TS))]
17415#[cfg_attr(feature = "ts", ts(export))]
17416pub struct ISBD_LINK_STATUS_DATA {
17417 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17418 pub timestamp: u64,
17419 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17420 pub last_heartbeat: u64,
17421 #[doc = "Number of failed SBD sessions."]
17422 pub failed_sessions: u16,
17423 #[doc = "Number of successful SBD sessions."]
17424 pub successful_sessions: u16,
17425 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17426 pub signal_quality: u8,
17427 #[doc = "1: Ring call pending, 0: No call pending."]
17428 pub ring_pending: u8,
17429 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17430 pub tx_session_pending: u8,
17431 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17432 pub rx_session_pending: u8,
17433}
17434impl ISBD_LINK_STATUS_DATA {
17435 pub const ENCODED_LEN: usize = 24usize;
17436 pub const DEFAULT: Self = Self {
17437 timestamp: 0_u64,
17438 last_heartbeat: 0_u64,
17439 failed_sessions: 0_u16,
17440 successful_sessions: 0_u16,
17441 signal_quality: 0_u8,
17442 ring_pending: 0_u8,
17443 tx_session_pending: 0_u8,
17444 rx_session_pending: 0_u8,
17445 };
17446 #[cfg(feature = "arbitrary")]
17447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17448 use arbitrary::{Arbitrary, Unstructured};
17449 let mut buf = [0u8; 1024];
17450 rng.fill_bytes(&mut buf);
17451 let mut unstructured = Unstructured::new(&buf);
17452 Self::arbitrary(&mut unstructured).unwrap_or_default()
17453 }
17454}
17455impl Default for ISBD_LINK_STATUS_DATA {
17456 fn default() -> Self {
17457 Self::DEFAULT.clone()
17458 }
17459}
17460impl MessageData for ISBD_LINK_STATUS_DATA {
17461 type Message = MavMessage;
17462 const ID: u32 = 335u32;
17463 const NAME: &'static str = "ISBD_LINK_STATUS";
17464 const EXTRA_CRC: u8 = 225u8;
17465 const ENCODED_LEN: usize = 24usize;
17466 fn deser(
17467 _version: MavlinkVersion,
17468 __input: &[u8],
17469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17470 let avail_len = __input.len();
17471 let mut payload_buf = [0; Self::ENCODED_LEN];
17472 let mut buf = if avail_len < Self::ENCODED_LEN {
17473 payload_buf[0..avail_len].copy_from_slice(__input);
17474 Bytes::new(&payload_buf)
17475 } else {
17476 Bytes::new(__input)
17477 };
17478 let mut __struct = Self::default();
17479 __struct.timestamp = buf.get_u64_le();
17480 __struct.last_heartbeat = buf.get_u64_le();
17481 __struct.failed_sessions = buf.get_u16_le();
17482 __struct.successful_sessions = buf.get_u16_le();
17483 __struct.signal_quality = buf.get_u8();
17484 __struct.ring_pending = buf.get_u8();
17485 __struct.tx_session_pending = buf.get_u8();
17486 __struct.rx_session_pending = buf.get_u8();
17487 Ok(__struct)
17488 }
17489 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17490 let mut __tmp = BytesMut::new(bytes);
17491 #[allow(clippy::absurd_extreme_comparisons)]
17492 #[allow(unused_comparisons)]
17493 if __tmp.remaining() < Self::ENCODED_LEN {
17494 panic!(
17495 "buffer is too small (need {} bytes, but got {})",
17496 Self::ENCODED_LEN,
17497 __tmp.remaining(),
17498 )
17499 }
17500 __tmp.put_u64_le(self.timestamp);
17501 __tmp.put_u64_le(self.last_heartbeat);
17502 __tmp.put_u16_le(self.failed_sessions);
17503 __tmp.put_u16_le(self.successful_sessions);
17504 __tmp.put_u8(self.signal_quality);
17505 __tmp.put_u8(self.ring_pending);
17506 __tmp.put_u8(self.tx_session_pending);
17507 __tmp.put_u8(self.rx_session_pending);
17508 if matches!(version, MavlinkVersion::V2) {
17509 let len = __tmp.len();
17510 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17511 } else {
17512 __tmp.len()
17513 }
17514 }
17515}
17516#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17517#[doc = ""]
17518#[doc = "ID: 149"]
17519#[derive(Debug, Clone, PartialEq)]
17520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17522#[cfg_attr(feature = "ts", derive(TS))]
17523#[cfg_attr(feature = "ts", ts(export))]
17524pub struct LANDING_TARGET_DATA {
17525 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17526 pub time_usec: u64,
17527 #[doc = "X-axis angular offset of the target from the center of the image"]
17528 pub angle_x: f32,
17529 #[doc = "Y-axis angular offset of the target from the center of the image"]
17530 pub angle_y: f32,
17531 #[doc = "Distance to the target from the vehicle"]
17532 pub distance: f32,
17533 #[doc = "Size of target along x-axis"]
17534 pub size_x: f32,
17535 #[doc = "Size of target along y-axis"]
17536 pub size_y: f32,
17537 #[doc = "The ID of the target if multiple targets are present"]
17538 pub target_num: u8,
17539 #[doc = "Coordinate frame used for following fields."]
17540 pub frame: MavFrame,
17541 #[doc = "X Position of the landing target in MAV_FRAME"]
17542 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17543 pub x: f32,
17544 #[doc = "Y Position of the landing target in MAV_FRAME"]
17545 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17546 pub y: f32,
17547 #[doc = "Z Position of the landing target in MAV_FRAME"]
17548 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17549 pub z: f32,
17550 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17551 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17552 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17553 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17554 pub q: [f32; 4],
17555 #[doc = "Type of landing target"]
17556 #[cfg_attr(feature = "serde", serde(default))]
17557 pub mavtype: LandingTargetType,
17558 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17559 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17560 pub position_valid: u8,
17561}
17562impl LANDING_TARGET_DATA {
17563 pub const ENCODED_LEN: usize = 60usize;
17564 pub const DEFAULT: Self = Self {
17565 time_usec: 0_u64,
17566 angle_x: 0.0_f32,
17567 angle_y: 0.0_f32,
17568 distance: 0.0_f32,
17569 size_x: 0.0_f32,
17570 size_y: 0.0_f32,
17571 target_num: 0_u8,
17572 frame: MavFrame::DEFAULT,
17573 x: 0.0_f32,
17574 y: 0.0_f32,
17575 z: 0.0_f32,
17576 q: [0.0_f32; 4usize],
17577 mavtype: LandingTargetType::DEFAULT,
17578 position_valid: 0_u8,
17579 };
17580 #[cfg(feature = "arbitrary")]
17581 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17582 use arbitrary::{Arbitrary, Unstructured};
17583 let mut buf = [0u8; 1024];
17584 rng.fill_bytes(&mut buf);
17585 let mut unstructured = Unstructured::new(&buf);
17586 Self::arbitrary(&mut unstructured).unwrap_or_default()
17587 }
17588}
17589impl Default for LANDING_TARGET_DATA {
17590 fn default() -> Self {
17591 Self::DEFAULT.clone()
17592 }
17593}
17594impl MessageData for LANDING_TARGET_DATA {
17595 type Message = MavMessage;
17596 const ID: u32 = 149u32;
17597 const NAME: &'static str = "LANDING_TARGET";
17598 const EXTRA_CRC: u8 = 200u8;
17599 const ENCODED_LEN: usize = 60usize;
17600 fn deser(
17601 _version: MavlinkVersion,
17602 __input: &[u8],
17603 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17604 let avail_len = __input.len();
17605 let mut payload_buf = [0; Self::ENCODED_LEN];
17606 let mut buf = if avail_len < Self::ENCODED_LEN {
17607 payload_buf[0..avail_len].copy_from_slice(__input);
17608 Bytes::new(&payload_buf)
17609 } else {
17610 Bytes::new(__input)
17611 };
17612 let mut __struct = Self::default();
17613 __struct.time_usec = buf.get_u64_le();
17614 __struct.angle_x = buf.get_f32_le();
17615 __struct.angle_y = buf.get_f32_le();
17616 __struct.distance = buf.get_f32_le();
17617 __struct.size_x = buf.get_f32_le();
17618 __struct.size_y = buf.get_f32_le();
17619 __struct.target_num = buf.get_u8();
17620 let tmp = buf.get_u8();
17621 __struct.frame =
17622 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17623 enum_type: "MavFrame",
17624 value: tmp as u32,
17625 })?;
17626 __struct.x = buf.get_f32_le();
17627 __struct.y = buf.get_f32_le();
17628 __struct.z = buf.get_f32_le();
17629 for v in &mut __struct.q {
17630 let val = buf.get_f32_le();
17631 *v = val;
17632 }
17633 let tmp = buf.get_u8();
17634 __struct.mavtype =
17635 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17636 enum_type: "LandingTargetType",
17637 value: tmp as u32,
17638 })?;
17639 __struct.position_valid = buf.get_u8();
17640 Ok(__struct)
17641 }
17642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17643 let mut __tmp = BytesMut::new(bytes);
17644 #[allow(clippy::absurd_extreme_comparisons)]
17645 #[allow(unused_comparisons)]
17646 if __tmp.remaining() < Self::ENCODED_LEN {
17647 panic!(
17648 "buffer is too small (need {} bytes, but got {})",
17649 Self::ENCODED_LEN,
17650 __tmp.remaining(),
17651 )
17652 }
17653 __tmp.put_u64_le(self.time_usec);
17654 __tmp.put_f32_le(self.angle_x);
17655 __tmp.put_f32_le(self.angle_y);
17656 __tmp.put_f32_le(self.distance);
17657 __tmp.put_f32_le(self.size_x);
17658 __tmp.put_f32_le(self.size_y);
17659 __tmp.put_u8(self.target_num);
17660 __tmp.put_u8(self.frame as u8);
17661 if matches!(version, MavlinkVersion::V2) {
17662 __tmp.put_f32_le(self.x);
17663 __tmp.put_f32_le(self.y);
17664 __tmp.put_f32_le(self.z);
17665 for val in &self.q {
17666 __tmp.put_f32_le(*val);
17667 }
17668 __tmp.put_u8(self.mavtype as u8);
17669 __tmp.put_u8(self.position_valid);
17670 let len = __tmp.len();
17671 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17672 } else {
17673 __tmp.len()
17674 }
17675 }
17676}
17677#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17678#[doc = ""]
17679#[doc = "ID: 8"]
17680#[derive(Debug, Clone, PartialEq)]
17681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17683#[cfg_attr(feature = "ts", derive(TS))]
17684#[cfg_attr(feature = "ts", ts(export))]
17685pub struct LINK_NODE_STATUS_DATA {
17686 #[doc = "Timestamp (time since system boot)."]
17687 pub timestamp: u64,
17688 #[doc = "Transmit rate"]
17689 pub tx_rate: u32,
17690 #[doc = "Receive rate"]
17691 pub rx_rate: u32,
17692 #[doc = "Messages sent"]
17693 pub messages_sent: u32,
17694 #[doc = "Messages received (estimated from counting seq)"]
17695 pub messages_received: u32,
17696 #[doc = "Messages lost (estimated from counting seq)"]
17697 pub messages_lost: u32,
17698 #[doc = "Number of bytes that could not be parsed correctly."]
17699 pub rx_parse_err: u16,
17700 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17701 pub tx_overflows: u16,
17702 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17703 pub rx_overflows: u16,
17704 #[doc = "Remaining free transmit buffer space"]
17705 pub tx_buf: u8,
17706 #[doc = "Remaining free receive buffer space"]
17707 pub rx_buf: u8,
17708}
17709impl LINK_NODE_STATUS_DATA {
17710 pub const ENCODED_LEN: usize = 36usize;
17711 pub const DEFAULT: Self = Self {
17712 timestamp: 0_u64,
17713 tx_rate: 0_u32,
17714 rx_rate: 0_u32,
17715 messages_sent: 0_u32,
17716 messages_received: 0_u32,
17717 messages_lost: 0_u32,
17718 rx_parse_err: 0_u16,
17719 tx_overflows: 0_u16,
17720 rx_overflows: 0_u16,
17721 tx_buf: 0_u8,
17722 rx_buf: 0_u8,
17723 };
17724 #[cfg(feature = "arbitrary")]
17725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17726 use arbitrary::{Arbitrary, Unstructured};
17727 let mut buf = [0u8; 1024];
17728 rng.fill_bytes(&mut buf);
17729 let mut unstructured = Unstructured::new(&buf);
17730 Self::arbitrary(&mut unstructured).unwrap_or_default()
17731 }
17732}
17733impl Default for LINK_NODE_STATUS_DATA {
17734 fn default() -> Self {
17735 Self::DEFAULT.clone()
17736 }
17737}
17738impl MessageData for LINK_NODE_STATUS_DATA {
17739 type Message = MavMessage;
17740 const ID: u32 = 8u32;
17741 const NAME: &'static str = "LINK_NODE_STATUS";
17742 const EXTRA_CRC: u8 = 117u8;
17743 const ENCODED_LEN: usize = 36usize;
17744 fn deser(
17745 _version: MavlinkVersion,
17746 __input: &[u8],
17747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17748 let avail_len = __input.len();
17749 let mut payload_buf = [0; Self::ENCODED_LEN];
17750 let mut buf = if avail_len < Self::ENCODED_LEN {
17751 payload_buf[0..avail_len].copy_from_slice(__input);
17752 Bytes::new(&payload_buf)
17753 } else {
17754 Bytes::new(__input)
17755 };
17756 let mut __struct = Self::default();
17757 __struct.timestamp = buf.get_u64_le();
17758 __struct.tx_rate = buf.get_u32_le();
17759 __struct.rx_rate = buf.get_u32_le();
17760 __struct.messages_sent = buf.get_u32_le();
17761 __struct.messages_received = buf.get_u32_le();
17762 __struct.messages_lost = buf.get_u32_le();
17763 __struct.rx_parse_err = buf.get_u16_le();
17764 __struct.tx_overflows = buf.get_u16_le();
17765 __struct.rx_overflows = buf.get_u16_le();
17766 __struct.tx_buf = buf.get_u8();
17767 __struct.rx_buf = buf.get_u8();
17768 Ok(__struct)
17769 }
17770 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17771 let mut __tmp = BytesMut::new(bytes);
17772 #[allow(clippy::absurd_extreme_comparisons)]
17773 #[allow(unused_comparisons)]
17774 if __tmp.remaining() < Self::ENCODED_LEN {
17775 panic!(
17776 "buffer is too small (need {} bytes, but got {})",
17777 Self::ENCODED_LEN,
17778 __tmp.remaining(),
17779 )
17780 }
17781 __tmp.put_u64_le(self.timestamp);
17782 __tmp.put_u32_le(self.tx_rate);
17783 __tmp.put_u32_le(self.rx_rate);
17784 __tmp.put_u32_le(self.messages_sent);
17785 __tmp.put_u32_le(self.messages_received);
17786 __tmp.put_u32_le(self.messages_lost);
17787 __tmp.put_u16_le(self.rx_parse_err);
17788 __tmp.put_u16_le(self.tx_overflows);
17789 __tmp.put_u16_le(self.rx_overflows);
17790 __tmp.put_u8(self.tx_buf);
17791 __tmp.put_u8(self.rx_buf);
17792 if matches!(version, MavlinkVersion::V2) {
17793 let len = __tmp.len();
17794 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17795 } else {
17796 __tmp.len()
17797 }
17798 }
17799}
17800#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17801#[doc = ""]
17802#[doc = "ID: 32"]
17803#[derive(Debug, Clone, PartialEq)]
17804#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17805#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17806#[cfg_attr(feature = "ts", derive(TS))]
17807#[cfg_attr(feature = "ts", ts(export))]
17808pub struct LOCAL_POSITION_NED_DATA {
17809 #[doc = "Timestamp (time since system boot)."]
17810 pub time_boot_ms: u32,
17811 #[doc = "X Position"]
17812 pub x: f32,
17813 #[doc = "Y Position"]
17814 pub y: f32,
17815 #[doc = "Z Position"]
17816 pub z: f32,
17817 #[doc = "X Speed"]
17818 pub vx: f32,
17819 #[doc = "Y Speed"]
17820 pub vy: f32,
17821 #[doc = "Z Speed"]
17822 pub vz: f32,
17823}
17824impl LOCAL_POSITION_NED_DATA {
17825 pub const ENCODED_LEN: usize = 28usize;
17826 pub const DEFAULT: Self = Self {
17827 time_boot_ms: 0_u32,
17828 x: 0.0_f32,
17829 y: 0.0_f32,
17830 z: 0.0_f32,
17831 vx: 0.0_f32,
17832 vy: 0.0_f32,
17833 vz: 0.0_f32,
17834 };
17835 #[cfg(feature = "arbitrary")]
17836 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17837 use arbitrary::{Arbitrary, Unstructured};
17838 let mut buf = [0u8; 1024];
17839 rng.fill_bytes(&mut buf);
17840 let mut unstructured = Unstructured::new(&buf);
17841 Self::arbitrary(&mut unstructured).unwrap_or_default()
17842 }
17843}
17844impl Default for LOCAL_POSITION_NED_DATA {
17845 fn default() -> Self {
17846 Self::DEFAULT.clone()
17847 }
17848}
17849impl MessageData for LOCAL_POSITION_NED_DATA {
17850 type Message = MavMessage;
17851 const ID: u32 = 32u32;
17852 const NAME: &'static str = "LOCAL_POSITION_NED";
17853 const EXTRA_CRC: u8 = 185u8;
17854 const ENCODED_LEN: usize = 28usize;
17855 fn deser(
17856 _version: MavlinkVersion,
17857 __input: &[u8],
17858 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17859 let avail_len = __input.len();
17860 let mut payload_buf = [0; Self::ENCODED_LEN];
17861 let mut buf = if avail_len < Self::ENCODED_LEN {
17862 payload_buf[0..avail_len].copy_from_slice(__input);
17863 Bytes::new(&payload_buf)
17864 } else {
17865 Bytes::new(__input)
17866 };
17867 let mut __struct = Self::default();
17868 __struct.time_boot_ms = buf.get_u32_le();
17869 __struct.x = buf.get_f32_le();
17870 __struct.y = buf.get_f32_le();
17871 __struct.z = buf.get_f32_le();
17872 __struct.vx = buf.get_f32_le();
17873 __struct.vy = buf.get_f32_le();
17874 __struct.vz = buf.get_f32_le();
17875 Ok(__struct)
17876 }
17877 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17878 let mut __tmp = BytesMut::new(bytes);
17879 #[allow(clippy::absurd_extreme_comparisons)]
17880 #[allow(unused_comparisons)]
17881 if __tmp.remaining() < Self::ENCODED_LEN {
17882 panic!(
17883 "buffer is too small (need {} bytes, but got {})",
17884 Self::ENCODED_LEN,
17885 __tmp.remaining(),
17886 )
17887 }
17888 __tmp.put_u32_le(self.time_boot_ms);
17889 __tmp.put_f32_le(self.x);
17890 __tmp.put_f32_le(self.y);
17891 __tmp.put_f32_le(self.z);
17892 __tmp.put_f32_le(self.vx);
17893 __tmp.put_f32_le(self.vy);
17894 __tmp.put_f32_le(self.vz);
17895 if matches!(version, MavlinkVersion::V2) {
17896 let len = __tmp.len();
17897 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17898 } else {
17899 __tmp.len()
17900 }
17901 }
17902}
17903#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17904#[doc = ""]
17905#[doc = "ID: 64"]
17906#[derive(Debug, Clone, PartialEq)]
17907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17909#[cfg_attr(feature = "ts", derive(TS))]
17910#[cfg_attr(feature = "ts", ts(export))]
17911pub struct LOCAL_POSITION_NED_COV_DATA {
17912 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17913 pub time_usec: u64,
17914 #[doc = "X Position"]
17915 pub x: f32,
17916 #[doc = "Y Position"]
17917 pub y: f32,
17918 #[doc = "Z Position"]
17919 pub z: f32,
17920 #[doc = "X Speed"]
17921 pub vx: f32,
17922 #[doc = "Y Speed"]
17923 pub vy: f32,
17924 #[doc = "Z Speed"]
17925 pub vz: f32,
17926 #[doc = "X Acceleration"]
17927 pub ax: f32,
17928 #[doc = "Y Acceleration"]
17929 pub ay: f32,
17930 #[doc = "Z Acceleration"]
17931 pub az: f32,
17932 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17933 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17934 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17935 pub covariance: [f32; 45],
17936 #[doc = "Class id of the estimator this estimate originated from."]
17937 pub estimator_type: MavEstimatorType,
17938}
17939impl LOCAL_POSITION_NED_COV_DATA {
17940 pub const ENCODED_LEN: usize = 225usize;
17941 pub const DEFAULT: Self = Self {
17942 time_usec: 0_u64,
17943 x: 0.0_f32,
17944 y: 0.0_f32,
17945 z: 0.0_f32,
17946 vx: 0.0_f32,
17947 vy: 0.0_f32,
17948 vz: 0.0_f32,
17949 ax: 0.0_f32,
17950 ay: 0.0_f32,
17951 az: 0.0_f32,
17952 covariance: [0.0_f32; 45usize],
17953 estimator_type: MavEstimatorType::DEFAULT,
17954 };
17955 #[cfg(feature = "arbitrary")]
17956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17957 use arbitrary::{Arbitrary, Unstructured};
17958 let mut buf = [0u8; 1024];
17959 rng.fill_bytes(&mut buf);
17960 let mut unstructured = Unstructured::new(&buf);
17961 Self::arbitrary(&mut unstructured).unwrap_or_default()
17962 }
17963}
17964impl Default for LOCAL_POSITION_NED_COV_DATA {
17965 fn default() -> Self {
17966 Self::DEFAULT.clone()
17967 }
17968}
17969impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17970 type Message = MavMessage;
17971 const ID: u32 = 64u32;
17972 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17973 const EXTRA_CRC: u8 = 191u8;
17974 const ENCODED_LEN: usize = 225usize;
17975 fn deser(
17976 _version: MavlinkVersion,
17977 __input: &[u8],
17978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17979 let avail_len = __input.len();
17980 let mut payload_buf = [0; Self::ENCODED_LEN];
17981 let mut buf = if avail_len < Self::ENCODED_LEN {
17982 payload_buf[0..avail_len].copy_from_slice(__input);
17983 Bytes::new(&payload_buf)
17984 } else {
17985 Bytes::new(__input)
17986 };
17987 let mut __struct = Self::default();
17988 __struct.time_usec = buf.get_u64_le();
17989 __struct.x = buf.get_f32_le();
17990 __struct.y = buf.get_f32_le();
17991 __struct.z = buf.get_f32_le();
17992 __struct.vx = buf.get_f32_le();
17993 __struct.vy = buf.get_f32_le();
17994 __struct.vz = buf.get_f32_le();
17995 __struct.ax = buf.get_f32_le();
17996 __struct.ay = buf.get_f32_le();
17997 __struct.az = buf.get_f32_le();
17998 for v in &mut __struct.covariance {
17999 let val = buf.get_f32_le();
18000 *v = val;
18001 }
18002 let tmp = buf.get_u8();
18003 __struct.estimator_type =
18004 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18005 enum_type: "MavEstimatorType",
18006 value: tmp as u32,
18007 })?;
18008 Ok(__struct)
18009 }
18010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18011 let mut __tmp = BytesMut::new(bytes);
18012 #[allow(clippy::absurd_extreme_comparisons)]
18013 #[allow(unused_comparisons)]
18014 if __tmp.remaining() < Self::ENCODED_LEN {
18015 panic!(
18016 "buffer is too small (need {} bytes, but got {})",
18017 Self::ENCODED_LEN,
18018 __tmp.remaining(),
18019 )
18020 }
18021 __tmp.put_u64_le(self.time_usec);
18022 __tmp.put_f32_le(self.x);
18023 __tmp.put_f32_le(self.y);
18024 __tmp.put_f32_le(self.z);
18025 __tmp.put_f32_le(self.vx);
18026 __tmp.put_f32_le(self.vy);
18027 __tmp.put_f32_le(self.vz);
18028 __tmp.put_f32_le(self.ax);
18029 __tmp.put_f32_le(self.ay);
18030 __tmp.put_f32_le(self.az);
18031 for val in &self.covariance {
18032 __tmp.put_f32_le(*val);
18033 }
18034 __tmp.put_u8(self.estimator_type as u8);
18035 if matches!(version, MavlinkVersion::V2) {
18036 let len = __tmp.len();
18037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18038 } else {
18039 __tmp.len()
18040 }
18041 }
18042}
18043#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18044#[doc = ""]
18045#[doc = "ID: 89"]
18046#[derive(Debug, Clone, PartialEq)]
18047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18049#[cfg_attr(feature = "ts", derive(TS))]
18050#[cfg_attr(feature = "ts", ts(export))]
18051pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18052 #[doc = "Timestamp (time since system boot)."]
18053 pub time_boot_ms: u32,
18054 #[doc = "X Position"]
18055 pub x: f32,
18056 #[doc = "Y Position"]
18057 pub y: f32,
18058 #[doc = "Z Position"]
18059 pub z: f32,
18060 #[doc = "Roll"]
18061 pub roll: f32,
18062 #[doc = "Pitch"]
18063 pub pitch: f32,
18064 #[doc = "Yaw"]
18065 pub yaw: f32,
18066}
18067impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18068 pub const ENCODED_LEN: usize = 28usize;
18069 pub const DEFAULT: Self = Self {
18070 time_boot_ms: 0_u32,
18071 x: 0.0_f32,
18072 y: 0.0_f32,
18073 z: 0.0_f32,
18074 roll: 0.0_f32,
18075 pitch: 0.0_f32,
18076 yaw: 0.0_f32,
18077 };
18078 #[cfg(feature = "arbitrary")]
18079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18080 use arbitrary::{Arbitrary, Unstructured};
18081 let mut buf = [0u8; 1024];
18082 rng.fill_bytes(&mut buf);
18083 let mut unstructured = Unstructured::new(&buf);
18084 Self::arbitrary(&mut unstructured).unwrap_or_default()
18085 }
18086}
18087impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18088 fn default() -> Self {
18089 Self::DEFAULT.clone()
18090 }
18091}
18092impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18093 type Message = MavMessage;
18094 const ID: u32 = 89u32;
18095 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18096 const EXTRA_CRC: u8 = 231u8;
18097 const ENCODED_LEN: usize = 28usize;
18098 fn deser(
18099 _version: MavlinkVersion,
18100 __input: &[u8],
18101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18102 let avail_len = __input.len();
18103 let mut payload_buf = [0; Self::ENCODED_LEN];
18104 let mut buf = if avail_len < Self::ENCODED_LEN {
18105 payload_buf[0..avail_len].copy_from_slice(__input);
18106 Bytes::new(&payload_buf)
18107 } else {
18108 Bytes::new(__input)
18109 };
18110 let mut __struct = Self::default();
18111 __struct.time_boot_ms = buf.get_u32_le();
18112 __struct.x = buf.get_f32_le();
18113 __struct.y = buf.get_f32_le();
18114 __struct.z = buf.get_f32_le();
18115 __struct.roll = buf.get_f32_le();
18116 __struct.pitch = buf.get_f32_le();
18117 __struct.yaw = buf.get_f32_le();
18118 Ok(__struct)
18119 }
18120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18121 let mut __tmp = BytesMut::new(bytes);
18122 #[allow(clippy::absurd_extreme_comparisons)]
18123 #[allow(unused_comparisons)]
18124 if __tmp.remaining() < Self::ENCODED_LEN {
18125 panic!(
18126 "buffer is too small (need {} bytes, but got {})",
18127 Self::ENCODED_LEN,
18128 __tmp.remaining(),
18129 )
18130 }
18131 __tmp.put_u32_le(self.time_boot_ms);
18132 __tmp.put_f32_le(self.x);
18133 __tmp.put_f32_le(self.y);
18134 __tmp.put_f32_le(self.z);
18135 __tmp.put_f32_le(self.roll);
18136 __tmp.put_f32_le(self.pitch);
18137 __tmp.put_f32_le(self.yaw);
18138 if matches!(version, MavlinkVersion::V2) {
18139 let len = __tmp.len();
18140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18141 } else {
18142 __tmp.len()
18143 }
18144 }
18145}
18146#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18147#[doc = ""]
18148#[doc = "ID: 268"]
18149#[derive(Debug, Clone, PartialEq)]
18150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18152#[cfg_attr(feature = "ts", derive(TS))]
18153#[cfg_attr(feature = "ts", ts(export))]
18154pub struct LOGGING_ACK_DATA {
18155 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18156 pub sequence: u16,
18157 #[doc = "system ID of the target"]
18158 pub target_system: u8,
18159 #[doc = "component ID of the target"]
18160 pub target_component: u8,
18161}
18162impl LOGGING_ACK_DATA {
18163 pub const ENCODED_LEN: usize = 4usize;
18164 pub const DEFAULT: Self = Self {
18165 sequence: 0_u16,
18166 target_system: 0_u8,
18167 target_component: 0_u8,
18168 };
18169 #[cfg(feature = "arbitrary")]
18170 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18171 use arbitrary::{Arbitrary, Unstructured};
18172 let mut buf = [0u8; 1024];
18173 rng.fill_bytes(&mut buf);
18174 let mut unstructured = Unstructured::new(&buf);
18175 Self::arbitrary(&mut unstructured).unwrap_or_default()
18176 }
18177}
18178impl Default for LOGGING_ACK_DATA {
18179 fn default() -> Self {
18180 Self::DEFAULT.clone()
18181 }
18182}
18183impl MessageData for LOGGING_ACK_DATA {
18184 type Message = MavMessage;
18185 const ID: u32 = 268u32;
18186 const NAME: &'static str = "LOGGING_ACK";
18187 const EXTRA_CRC: u8 = 14u8;
18188 const ENCODED_LEN: usize = 4usize;
18189 fn deser(
18190 _version: MavlinkVersion,
18191 __input: &[u8],
18192 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18193 let avail_len = __input.len();
18194 let mut payload_buf = [0; Self::ENCODED_LEN];
18195 let mut buf = if avail_len < Self::ENCODED_LEN {
18196 payload_buf[0..avail_len].copy_from_slice(__input);
18197 Bytes::new(&payload_buf)
18198 } else {
18199 Bytes::new(__input)
18200 };
18201 let mut __struct = Self::default();
18202 __struct.sequence = buf.get_u16_le();
18203 __struct.target_system = buf.get_u8();
18204 __struct.target_component = buf.get_u8();
18205 Ok(__struct)
18206 }
18207 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18208 let mut __tmp = BytesMut::new(bytes);
18209 #[allow(clippy::absurd_extreme_comparisons)]
18210 #[allow(unused_comparisons)]
18211 if __tmp.remaining() < Self::ENCODED_LEN {
18212 panic!(
18213 "buffer is too small (need {} bytes, but got {})",
18214 Self::ENCODED_LEN,
18215 __tmp.remaining(),
18216 )
18217 }
18218 __tmp.put_u16_le(self.sequence);
18219 __tmp.put_u8(self.target_system);
18220 __tmp.put_u8(self.target_component);
18221 if matches!(version, MavlinkVersion::V2) {
18222 let len = __tmp.len();
18223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18224 } else {
18225 __tmp.len()
18226 }
18227 }
18228}
18229#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18230#[doc = ""]
18231#[doc = "ID: 266"]
18232#[derive(Debug, Clone, PartialEq)]
18233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18235#[cfg_attr(feature = "ts", derive(TS))]
18236#[cfg_attr(feature = "ts", ts(export))]
18237pub struct LOGGING_DATA_DATA {
18238 #[doc = "sequence number (can wrap)"]
18239 pub sequence: u16,
18240 #[doc = "system ID of the target"]
18241 pub target_system: u8,
18242 #[doc = "component ID of the target"]
18243 pub target_component: u8,
18244 #[doc = "data length"]
18245 pub length: u8,
18246 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18247 pub first_message_offset: u8,
18248 #[doc = "logged data"]
18249 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18250 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18251 pub data: [u8; 249],
18252}
18253impl LOGGING_DATA_DATA {
18254 pub const ENCODED_LEN: usize = 255usize;
18255 pub const DEFAULT: Self = Self {
18256 sequence: 0_u16,
18257 target_system: 0_u8,
18258 target_component: 0_u8,
18259 length: 0_u8,
18260 first_message_offset: 0_u8,
18261 data: [0_u8; 249usize],
18262 };
18263 #[cfg(feature = "arbitrary")]
18264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18265 use arbitrary::{Arbitrary, Unstructured};
18266 let mut buf = [0u8; 1024];
18267 rng.fill_bytes(&mut buf);
18268 let mut unstructured = Unstructured::new(&buf);
18269 Self::arbitrary(&mut unstructured).unwrap_or_default()
18270 }
18271}
18272impl Default for LOGGING_DATA_DATA {
18273 fn default() -> Self {
18274 Self::DEFAULT.clone()
18275 }
18276}
18277impl MessageData for LOGGING_DATA_DATA {
18278 type Message = MavMessage;
18279 const ID: u32 = 266u32;
18280 const NAME: &'static str = "LOGGING_DATA";
18281 const EXTRA_CRC: u8 = 193u8;
18282 const ENCODED_LEN: usize = 255usize;
18283 fn deser(
18284 _version: MavlinkVersion,
18285 __input: &[u8],
18286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18287 let avail_len = __input.len();
18288 let mut payload_buf = [0; Self::ENCODED_LEN];
18289 let mut buf = if avail_len < Self::ENCODED_LEN {
18290 payload_buf[0..avail_len].copy_from_slice(__input);
18291 Bytes::new(&payload_buf)
18292 } else {
18293 Bytes::new(__input)
18294 };
18295 let mut __struct = Self::default();
18296 __struct.sequence = buf.get_u16_le();
18297 __struct.target_system = buf.get_u8();
18298 __struct.target_component = buf.get_u8();
18299 __struct.length = buf.get_u8();
18300 __struct.first_message_offset = buf.get_u8();
18301 for v in &mut __struct.data {
18302 let val = buf.get_u8();
18303 *v = val;
18304 }
18305 Ok(__struct)
18306 }
18307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18308 let mut __tmp = BytesMut::new(bytes);
18309 #[allow(clippy::absurd_extreme_comparisons)]
18310 #[allow(unused_comparisons)]
18311 if __tmp.remaining() < Self::ENCODED_LEN {
18312 panic!(
18313 "buffer is too small (need {} bytes, but got {})",
18314 Self::ENCODED_LEN,
18315 __tmp.remaining(),
18316 )
18317 }
18318 __tmp.put_u16_le(self.sequence);
18319 __tmp.put_u8(self.target_system);
18320 __tmp.put_u8(self.target_component);
18321 __tmp.put_u8(self.length);
18322 __tmp.put_u8(self.first_message_offset);
18323 for val in &self.data {
18324 __tmp.put_u8(*val);
18325 }
18326 if matches!(version, MavlinkVersion::V2) {
18327 let len = __tmp.len();
18328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18329 } else {
18330 __tmp.len()
18331 }
18332 }
18333}
18334#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18335#[doc = ""]
18336#[doc = "ID: 267"]
18337#[derive(Debug, Clone, PartialEq)]
18338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18340#[cfg_attr(feature = "ts", derive(TS))]
18341#[cfg_attr(feature = "ts", ts(export))]
18342pub struct LOGGING_DATA_ACKED_DATA {
18343 #[doc = "sequence number (can wrap)"]
18344 pub sequence: u16,
18345 #[doc = "system ID of the target"]
18346 pub target_system: u8,
18347 #[doc = "component ID of the target"]
18348 pub target_component: u8,
18349 #[doc = "data length"]
18350 pub length: u8,
18351 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18352 pub first_message_offset: u8,
18353 #[doc = "logged data"]
18354 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18355 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18356 pub data: [u8; 249],
18357}
18358impl LOGGING_DATA_ACKED_DATA {
18359 pub const ENCODED_LEN: usize = 255usize;
18360 pub const DEFAULT: Self = Self {
18361 sequence: 0_u16,
18362 target_system: 0_u8,
18363 target_component: 0_u8,
18364 length: 0_u8,
18365 first_message_offset: 0_u8,
18366 data: [0_u8; 249usize],
18367 };
18368 #[cfg(feature = "arbitrary")]
18369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18370 use arbitrary::{Arbitrary, Unstructured};
18371 let mut buf = [0u8; 1024];
18372 rng.fill_bytes(&mut buf);
18373 let mut unstructured = Unstructured::new(&buf);
18374 Self::arbitrary(&mut unstructured).unwrap_or_default()
18375 }
18376}
18377impl Default for LOGGING_DATA_ACKED_DATA {
18378 fn default() -> Self {
18379 Self::DEFAULT.clone()
18380 }
18381}
18382impl MessageData for LOGGING_DATA_ACKED_DATA {
18383 type Message = MavMessage;
18384 const ID: u32 = 267u32;
18385 const NAME: &'static str = "LOGGING_DATA_ACKED";
18386 const EXTRA_CRC: u8 = 35u8;
18387 const ENCODED_LEN: usize = 255usize;
18388 fn deser(
18389 _version: MavlinkVersion,
18390 __input: &[u8],
18391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18392 let avail_len = __input.len();
18393 let mut payload_buf = [0; Self::ENCODED_LEN];
18394 let mut buf = if avail_len < Self::ENCODED_LEN {
18395 payload_buf[0..avail_len].copy_from_slice(__input);
18396 Bytes::new(&payload_buf)
18397 } else {
18398 Bytes::new(__input)
18399 };
18400 let mut __struct = Self::default();
18401 __struct.sequence = buf.get_u16_le();
18402 __struct.target_system = buf.get_u8();
18403 __struct.target_component = buf.get_u8();
18404 __struct.length = buf.get_u8();
18405 __struct.first_message_offset = buf.get_u8();
18406 for v in &mut __struct.data {
18407 let val = buf.get_u8();
18408 *v = val;
18409 }
18410 Ok(__struct)
18411 }
18412 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18413 let mut __tmp = BytesMut::new(bytes);
18414 #[allow(clippy::absurd_extreme_comparisons)]
18415 #[allow(unused_comparisons)]
18416 if __tmp.remaining() < Self::ENCODED_LEN {
18417 panic!(
18418 "buffer is too small (need {} bytes, but got {})",
18419 Self::ENCODED_LEN,
18420 __tmp.remaining(),
18421 )
18422 }
18423 __tmp.put_u16_le(self.sequence);
18424 __tmp.put_u8(self.target_system);
18425 __tmp.put_u8(self.target_component);
18426 __tmp.put_u8(self.length);
18427 __tmp.put_u8(self.first_message_offset);
18428 for val in &self.data {
18429 __tmp.put_u8(*val);
18430 }
18431 if matches!(version, MavlinkVersion::V2) {
18432 let len = __tmp.len();
18433 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18434 } else {
18435 __tmp.len()
18436 }
18437 }
18438}
18439#[doc = "Reply to LOG_REQUEST_DATA."]
18440#[doc = ""]
18441#[doc = "ID: 120"]
18442#[derive(Debug, Clone, PartialEq)]
18443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18445#[cfg_attr(feature = "ts", derive(TS))]
18446#[cfg_attr(feature = "ts", ts(export))]
18447pub struct LOG_DATA_DATA {
18448 #[doc = "Offset into the log"]
18449 pub ofs: u32,
18450 #[doc = "Log id (from LOG_ENTRY reply)"]
18451 pub id: u16,
18452 #[doc = "Number of bytes (zero for end of log)"]
18453 pub count: u8,
18454 #[doc = "log data"]
18455 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18456 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18457 pub data: [u8; 90],
18458}
18459impl LOG_DATA_DATA {
18460 pub const ENCODED_LEN: usize = 97usize;
18461 pub const DEFAULT: Self = Self {
18462 ofs: 0_u32,
18463 id: 0_u16,
18464 count: 0_u8,
18465 data: [0_u8; 90usize],
18466 };
18467 #[cfg(feature = "arbitrary")]
18468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18469 use arbitrary::{Arbitrary, Unstructured};
18470 let mut buf = [0u8; 1024];
18471 rng.fill_bytes(&mut buf);
18472 let mut unstructured = Unstructured::new(&buf);
18473 Self::arbitrary(&mut unstructured).unwrap_or_default()
18474 }
18475}
18476impl Default for LOG_DATA_DATA {
18477 fn default() -> Self {
18478 Self::DEFAULT.clone()
18479 }
18480}
18481impl MessageData for LOG_DATA_DATA {
18482 type Message = MavMessage;
18483 const ID: u32 = 120u32;
18484 const NAME: &'static str = "LOG_DATA";
18485 const EXTRA_CRC: u8 = 134u8;
18486 const ENCODED_LEN: usize = 97usize;
18487 fn deser(
18488 _version: MavlinkVersion,
18489 __input: &[u8],
18490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18491 let avail_len = __input.len();
18492 let mut payload_buf = [0; Self::ENCODED_LEN];
18493 let mut buf = if avail_len < Self::ENCODED_LEN {
18494 payload_buf[0..avail_len].copy_from_slice(__input);
18495 Bytes::new(&payload_buf)
18496 } else {
18497 Bytes::new(__input)
18498 };
18499 let mut __struct = Self::default();
18500 __struct.ofs = buf.get_u32_le();
18501 __struct.id = buf.get_u16_le();
18502 __struct.count = buf.get_u8();
18503 for v in &mut __struct.data {
18504 let val = buf.get_u8();
18505 *v = val;
18506 }
18507 Ok(__struct)
18508 }
18509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18510 let mut __tmp = BytesMut::new(bytes);
18511 #[allow(clippy::absurd_extreme_comparisons)]
18512 #[allow(unused_comparisons)]
18513 if __tmp.remaining() < Self::ENCODED_LEN {
18514 panic!(
18515 "buffer is too small (need {} bytes, but got {})",
18516 Self::ENCODED_LEN,
18517 __tmp.remaining(),
18518 )
18519 }
18520 __tmp.put_u32_le(self.ofs);
18521 __tmp.put_u16_le(self.id);
18522 __tmp.put_u8(self.count);
18523 for val in &self.data {
18524 __tmp.put_u8(*val);
18525 }
18526 if matches!(version, MavlinkVersion::V2) {
18527 let len = __tmp.len();
18528 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18529 } else {
18530 __tmp.len()
18531 }
18532 }
18533}
18534#[doc = "Reply to LOG_REQUEST_LIST."]
18535#[doc = ""]
18536#[doc = "ID: 118"]
18537#[derive(Debug, Clone, PartialEq)]
18538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18540#[cfg_attr(feature = "ts", derive(TS))]
18541#[cfg_attr(feature = "ts", ts(export))]
18542pub struct LOG_ENTRY_DATA {
18543 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18544 pub time_utc: u32,
18545 #[doc = "Size of the log (may be approximate)"]
18546 pub size: u32,
18547 #[doc = "Log id"]
18548 pub id: u16,
18549 #[doc = "Total number of logs"]
18550 pub num_logs: u16,
18551 #[doc = "High log number"]
18552 pub last_log_num: u16,
18553}
18554impl LOG_ENTRY_DATA {
18555 pub const ENCODED_LEN: usize = 14usize;
18556 pub const DEFAULT: Self = Self {
18557 time_utc: 0_u32,
18558 size: 0_u32,
18559 id: 0_u16,
18560 num_logs: 0_u16,
18561 last_log_num: 0_u16,
18562 };
18563 #[cfg(feature = "arbitrary")]
18564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18565 use arbitrary::{Arbitrary, Unstructured};
18566 let mut buf = [0u8; 1024];
18567 rng.fill_bytes(&mut buf);
18568 let mut unstructured = Unstructured::new(&buf);
18569 Self::arbitrary(&mut unstructured).unwrap_or_default()
18570 }
18571}
18572impl Default for LOG_ENTRY_DATA {
18573 fn default() -> Self {
18574 Self::DEFAULT.clone()
18575 }
18576}
18577impl MessageData for LOG_ENTRY_DATA {
18578 type Message = MavMessage;
18579 const ID: u32 = 118u32;
18580 const NAME: &'static str = "LOG_ENTRY";
18581 const EXTRA_CRC: u8 = 56u8;
18582 const ENCODED_LEN: usize = 14usize;
18583 fn deser(
18584 _version: MavlinkVersion,
18585 __input: &[u8],
18586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18587 let avail_len = __input.len();
18588 let mut payload_buf = [0; Self::ENCODED_LEN];
18589 let mut buf = if avail_len < Self::ENCODED_LEN {
18590 payload_buf[0..avail_len].copy_from_slice(__input);
18591 Bytes::new(&payload_buf)
18592 } else {
18593 Bytes::new(__input)
18594 };
18595 let mut __struct = Self::default();
18596 __struct.time_utc = buf.get_u32_le();
18597 __struct.size = buf.get_u32_le();
18598 __struct.id = buf.get_u16_le();
18599 __struct.num_logs = buf.get_u16_le();
18600 __struct.last_log_num = buf.get_u16_le();
18601 Ok(__struct)
18602 }
18603 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18604 let mut __tmp = BytesMut::new(bytes);
18605 #[allow(clippy::absurd_extreme_comparisons)]
18606 #[allow(unused_comparisons)]
18607 if __tmp.remaining() < Self::ENCODED_LEN {
18608 panic!(
18609 "buffer is too small (need {} bytes, but got {})",
18610 Self::ENCODED_LEN,
18611 __tmp.remaining(),
18612 )
18613 }
18614 __tmp.put_u32_le(self.time_utc);
18615 __tmp.put_u32_le(self.size);
18616 __tmp.put_u16_le(self.id);
18617 __tmp.put_u16_le(self.num_logs);
18618 __tmp.put_u16_le(self.last_log_num);
18619 if matches!(version, MavlinkVersion::V2) {
18620 let len = __tmp.len();
18621 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18622 } else {
18623 __tmp.len()
18624 }
18625 }
18626}
18627#[doc = "Erase all logs."]
18628#[doc = ""]
18629#[doc = "ID: 121"]
18630#[derive(Debug, Clone, PartialEq)]
18631#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18632#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18633#[cfg_attr(feature = "ts", derive(TS))]
18634#[cfg_attr(feature = "ts", ts(export))]
18635pub struct LOG_ERASE_DATA {
18636 #[doc = "System ID"]
18637 pub target_system: u8,
18638 #[doc = "Component ID"]
18639 pub target_component: u8,
18640}
18641impl LOG_ERASE_DATA {
18642 pub const ENCODED_LEN: usize = 2usize;
18643 pub const DEFAULT: Self = Self {
18644 target_system: 0_u8,
18645 target_component: 0_u8,
18646 };
18647 #[cfg(feature = "arbitrary")]
18648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18649 use arbitrary::{Arbitrary, Unstructured};
18650 let mut buf = [0u8; 1024];
18651 rng.fill_bytes(&mut buf);
18652 let mut unstructured = Unstructured::new(&buf);
18653 Self::arbitrary(&mut unstructured).unwrap_or_default()
18654 }
18655}
18656impl Default for LOG_ERASE_DATA {
18657 fn default() -> Self {
18658 Self::DEFAULT.clone()
18659 }
18660}
18661impl MessageData for LOG_ERASE_DATA {
18662 type Message = MavMessage;
18663 const ID: u32 = 121u32;
18664 const NAME: &'static str = "LOG_ERASE";
18665 const EXTRA_CRC: u8 = 237u8;
18666 const ENCODED_LEN: usize = 2usize;
18667 fn deser(
18668 _version: MavlinkVersion,
18669 __input: &[u8],
18670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18671 let avail_len = __input.len();
18672 let mut payload_buf = [0; Self::ENCODED_LEN];
18673 let mut buf = if avail_len < Self::ENCODED_LEN {
18674 payload_buf[0..avail_len].copy_from_slice(__input);
18675 Bytes::new(&payload_buf)
18676 } else {
18677 Bytes::new(__input)
18678 };
18679 let mut __struct = Self::default();
18680 __struct.target_system = buf.get_u8();
18681 __struct.target_component = buf.get_u8();
18682 Ok(__struct)
18683 }
18684 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18685 let mut __tmp = BytesMut::new(bytes);
18686 #[allow(clippy::absurd_extreme_comparisons)]
18687 #[allow(unused_comparisons)]
18688 if __tmp.remaining() < Self::ENCODED_LEN {
18689 panic!(
18690 "buffer is too small (need {} bytes, but got {})",
18691 Self::ENCODED_LEN,
18692 __tmp.remaining(),
18693 )
18694 }
18695 __tmp.put_u8(self.target_system);
18696 __tmp.put_u8(self.target_component);
18697 if matches!(version, MavlinkVersion::V2) {
18698 let len = __tmp.len();
18699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18700 } else {
18701 __tmp.len()
18702 }
18703 }
18704}
18705#[doc = "Request a chunk of a log."]
18706#[doc = ""]
18707#[doc = "ID: 119"]
18708#[derive(Debug, Clone, PartialEq)]
18709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18711#[cfg_attr(feature = "ts", derive(TS))]
18712#[cfg_attr(feature = "ts", ts(export))]
18713pub struct LOG_REQUEST_DATA_DATA {
18714 #[doc = "Offset into the log"]
18715 pub ofs: u32,
18716 #[doc = "Number of bytes"]
18717 pub count: u32,
18718 #[doc = "Log id (from LOG_ENTRY reply)"]
18719 pub id: u16,
18720 #[doc = "System ID"]
18721 pub target_system: u8,
18722 #[doc = "Component ID"]
18723 pub target_component: u8,
18724}
18725impl LOG_REQUEST_DATA_DATA {
18726 pub const ENCODED_LEN: usize = 12usize;
18727 pub const DEFAULT: Self = Self {
18728 ofs: 0_u32,
18729 count: 0_u32,
18730 id: 0_u16,
18731 target_system: 0_u8,
18732 target_component: 0_u8,
18733 };
18734 #[cfg(feature = "arbitrary")]
18735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18736 use arbitrary::{Arbitrary, Unstructured};
18737 let mut buf = [0u8; 1024];
18738 rng.fill_bytes(&mut buf);
18739 let mut unstructured = Unstructured::new(&buf);
18740 Self::arbitrary(&mut unstructured).unwrap_or_default()
18741 }
18742}
18743impl Default for LOG_REQUEST_DATA_DATA {
18744 fn default() -> Self {
18745 Self::DEFAULT.clone()
18746 }
18747}
18748impl MessageData for LOG_REQUEST_DATA_DATA {
18749 type Message = MavMessage;
18750 const ID: u32 = 119u32;
18751 const NAME: &'static str = "LOG_REQUEST_DATA";
18752 const EXTRA_CRC: u8 = 116u8;
18753 const ENCODED_LEN: usize = 12usize;
18754 fn deser(
18755 _version: MavlinkVersion,
18756 __input: &[u8],
18757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18758 let avail_len = __input.len();
18759 let mut payload_buf = [0; Self::ENCODED_LEN];
18760 let mut buf = if avail_len < Self::ENCODED_LEN {
18761 payload_buf[0..avail_len].copy_from_slice(__input);
18762 Bytes::new(&payload_buf)
18763 } else {
18764 Bytes::new(__input)
18765 };
18766 let mut __struct = Self::default();
18767 __struct.ofs = buf.get_u32_le();
18768 __struct.count = buf.get_u32_le();
18769 __struct.id = buf.get_u16_le();
18770 __struct.target_system = buf.get_u8();
18771 __struct.target_component = buf.get_u8();
18772 Ok(__struct)
18773 }
18774 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18775 let mut __tmp = BytesMut::new(bytes);
18776 #[allow(clippy::absurd_extreme_comparisons)]
18777 #[allow(unused_comparisons)]
18778 if __tmp.remaining() < Self::ENCODED_LEN {
18779 panic!(
18780 "buffer is too small (need {} bytes, but got {})",
18781 Self::ENCODED_LEN,
18782 __tmp.remaining(),
18783 )
18784 }
18785 __tmp.put_u32_le(self.ofs);
18786 __tmp.put_u32_le(self.count);
18787 __tmp.put_u16_le(self.id);
18788 __tmp.put_u8(self.target_system);
18789 __tmp.put_u8(self.target_component);
18790 if matches!(version, MavlinkVersion::V2) {
18791 let len = __tmp.len();
18792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18793 } else {
18794 __tmp.len()
18795 }
18796 }
18797}
18798#[doc = "Stop log transfer and resume normal logging."]
18799#[doc = ""]
18800#[doc = "ID: 122"]
18801#[derive(Debug, Clone, PartialEq)]
18802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18804#[cfg_attr(feature = "ts", derive(TS))]
18805#[cfg_attr(feature = "ts", ts(export))]
18806pub struct LOG_REQUEST_END_DATA {
18807 #[doc = "System ID"]
18808 pub target_system: u8,
18809 #[doc = "Component ID"]
18810 pub target_component: u8,
18811}
18812impl LOG_REQUEST_END_DATA {
18813 pub const ENCODED_LEN: usize = 2usize;
18814 pub const DEFAULT: Self = Self {
18815 target_system: 0_u8,
18816 target_component: 0_u8,
18817 };
18818 #[cfg(feature = "arbitrary")]
18819 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18820 use arbitrary::{Arbitrary, Unstructured};
18821 let mut buf = [0u8; 1024];
18822 rng.fill_bytes(&mut buf);
18823 let mut unstructured = Unstructured::new(&buf);
18824 Self::arbitrary(&mut unstructured).unwrap_or_default()
18825 }
18826}
18827impl Default for LOG_REQUEST_END_DATA {
18828 fn default() -> Self {
18829 Self::DEFAULT.clone()
18830 }
18831}
18832impl MessageData for LOG_REQUEST_END_DATA {
18833 type Message = MavMessage;
18834 const ID: u32 = 122u32;
18835 const NAME: &'static str = "LOG_REQUEST_END";
18836 const EXTRA_CRC: u8 = 203u8;
18837 const ENCODED_LEN: usize = 2usize;
18838 fn deser(
18839 _version: MavlinkVersion,
18840 __input: &[u8],
18841 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18842 let avail_len = __input.len();
18843 let mut payload_buf = [0; Self::ENCODED_LEN];
18844 let mut buf = if avail_len < Self::ENCODED_LEN {
18845 payload_buf[0..avail_len].copy_from_slice(__input);
18846 Bytes::new(&payload_buf)
18847 } else {
18848 Bytes::new(__input)
18849 };
18850 let mut __struct = Self::default();
18851 __struct.target_system = buf.get_u8();
18852 __struct.target_component = buf.get_u8();
18853 Ok(__struct)
18854 }
18855 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18856 let mut __tmp = BytesMut::new(bytes);
18857 #[allow(clippy::absurd_extreme_comparisons)]
18858 #[allow(unused_comparisons)]
18859 if __tmp.remaining() < Self::ENCODED_LEN {
18860 panic!(
18861 "buffer is too small (need {} bytes, but got {})",
18862 Self::ENCODED_LEN,
18863 __tmp.remaining(),
18864 )
18865 }
18866 __tmp.put_u8(self.target_system);
18867 __tmp.put_u8(self.target_component);
18868 if matches!(version, MavlinkVersion::V2) {
18869 let len = __tmp.len();
18870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18871 } else {
18872 __tmp.len()
18873 }
18874 }
18875}
18876#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18877#[doc = ""]
18878#[doc = "ID: 117"]
18879#[derive(Debug, Clone, PartialEq)]
18880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18882#[cfg_attr(feature = "ts", derive(TS))]
18883#[cfg_attr(feature = "ts", ts(export))]
18884pub struct LOG_REQUEST_LIST_DATA {
18885 #[doc = "First log id (0 for first available)"]
18886 pub start: u16,
18887 #[doc = "Last log id (0xffff for last available)"]
18888 pub end: u16,
18889 #[doc = "System ID"]
18890 pub target_system: u8,
18891 #[doc = "Component ID"]
18892 pub target_component: u8,
18893}
18894impl LOG_REQUEST_LIST_DATA {
18895 pub const ENCODED_LEN: usize = 6usize;
18896 pub const DEFAULT: Self = Self {
18897 start: 0_u16,
18898 end: 0_u16,
18899 target_system: 0_u8,
18900 target_component: 0_u8,
18901 };
18902 #[cfg(feature = "arbitrary")]
18903 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18904 use arbitrary::{Arbitrary, Unstructured};
18905 let mut buf = [0u8; 1024];
18906 rng.fill_bytes(&mut buf);
18907 let mut unstructured = Unstructured::new(&buf);
18908 Self::arbitrary(&mut unstructured).unwrap_or_default()
18909 }
18910}
18911impl Default for LOG_REQUEST_LIST_DATA {
18912 fn default() -> Self {
18913 Self::DEFAULT.clone()
18914 }
18915}
18916impl MessageData for LOG_REQUEST_LIST_DATA {
18917 type Message = MavMessage;
18918 const ID: u32 = 117u32;
18919 const NAME: &'static str = "LOG_REQUEST_LIST";
18920 const EXTRA_CRC: u8 = 128u8;
18921 const ENCODED_LEN: usize = 6usize;
18922 fn deser(
18923 _version: MavlinkVersion,
18924 __input: &[u8],
18925 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18926 let avail_len = __input.len();
18927 let mut payload_buf = [0; Self::ENCODED_LEN];
18928 let mut buf = if avail_len < Self::ENCODED_LEN {
18929 payload_buf[0..avail_len].copy_from_slice(__input);
18930 Bytes::new(&payload_buf)
18931 } else {
18932 Bytes::new(__input)
18933 };
18934 let mut __struct = Self::default();
18935 __struct.start = buf.get_u16_le();
18936 __struct.end = buf.get_u16_le();
18937 __struct.target_system = buf.get_u8();
18938 __struct.target_component = buf.get_u8();
18939 Ok(__struct)
18940 }
18941 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18942 let mut __tmp = BytesMut::new(bytes);
18943 #[allow(clippy::absurd_extreme_comparisons)]
18944 #[allow(unused_comparisons)]
18945 if __tmp.remaining() < Self::ENCODED_LEN {
18946 panic!(
18947 "buffer is too small (need {} bytes, but got {})",
18948 Self::ENCODED_LEN,
18949 __tmp.remaining(),
18950 )
18951 }
18952 __tmp.put_u16_le(self.start);
18953 __tmp.put_u16_le(self.end);
18954 __tmp.put_u8(self.target_system);
18955 __tmp.put_u8(self.target_component);
18956 if matches!(version, MavlinkVersion::V2) {
18957 let len = __tmp.len();
18958 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18959 } else {
18960 __tmp.len()
18961 }
18962 }
18963}
18964#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18965#[doc = ""]
18966#[doc = "ID: 192"]
18967#[derive(Debug, Clone, PartialEq)]
18968#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18969#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18970#[cfg_attr(feature = "ts", derive(TS))]
18971#[cfg_attr(feature = "ts", ts(export))]
18972pub struct MAG_CAL_REPORT_DATA {
18973 #[doc = "RMS milligauss residuals."]
18974 pub fitness: f32,
18975 #[doc = "X offset."]
18976 pub ofs_x: f32,
18977 #[doc = "Y offset."]
18978 pub ofs_y: f32,
18979 #[doc = "Z offset."]
18980 pub ofs_z: f32,
18981 #[doc = "X diagonal (matrix 11)."]
18982 pub diag_x: f32,
18983 #[doc = "Y diagonal (matrix 22)."]
18984 pub diag_y: f32,
18985 #[doc = "Z diagonal (matrix 33)."]
18986 pub diag_z: f32,
18987 #[doc = "X off-diagonal (matrix 12 and 21)."]
18988 pub offdiag_x: f32,
18989 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18990 pub offdiag_y: f32,
18991 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18992 pub offdiag_z: f32,
18993 #[doc = "Compass being calibrated."]
18994 pub compass_id: u8,
18995 #[doc = "Bitmask of compasses being calibrated."]
18996 pub cal_mask: u8,
18997 #[doc = "Calibration Status."]
18998 pub cal_status: MagCalStatus,
18999 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
19000 pub autosaved: u8,
19001 #[doc = "Confidence in orientation (higher is better)."]
19002 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19003 pub orientation_confidence: f32,
19004 #[doc = "orientation before calibration."]
19005 #[cfg_attr(feature = "serde", serde(default))]
19006 pub old_orientation: MavSensorOrientation,
19007 #[doc = "orientation after calibration."]
19008 #[cfg_attr(feature = "serde", serde(default))]
19009 pub new_orientation: MavSensorOrientation,
19010 #[doc = "field radius correction factor"]
19011 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19012 pub scale_factor: f32,
19013}
19014impl MAG_CAL_REPORT_DATA {
19015 pub const ENCODED_LEN: usize = 54usize;
19016 pub const DEFAULT: Self = Self {
19017 fitness: 0.0_f32,
19018 ofs_x: 0.0_f32,
19019 ofs_y: 0.0_f32,
19020 ofs_z: 0.0_f32,
19021 diag_x: 0.0_f32,
19022 diag_y: 0.0_f32,
19023 diag_z: 0.0_f32,
19024 offdiag_x: 0.0_f32,
19025 offdiag_y: 0.0_f32,
19026 offdiag_z: 0.0_f32,
19027 compass_id: 0_u8,
19028 cal_mask: 0_u8,
19029 cal_status: MagCalStatus::DEFAULT,
19030 autosaved: 0_u8,
19031 orientation_confidence: 0.0_f32,
19032 old_orientation: MavSensorOrientation::DEFAULT,
19033 new_orientation: MavSensorOrientation::DEFAULT,
19034 scale_factor: 0.0_f32,
19035 };
19036 #[cfg(feature = "arbitrary")]
19037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19038 use arbitrary::{Arbitrary, Unstructured};
19039 let mut buf = [0u8; 1024];
19040 rng.fill_bytes(&mut buf);
19041 let mut unstructured = Unstructured::new(&buf);
19042 Self::arbitrary(&mut unstructured).unwrap_or_default()
19043 }
19044}
19045impl Default for MAG_CAL_REPORT_DATA {
19046 fn default() -> Self {
19047 Self::DEFAULT.clone()
19048 }
19049}
19050impl MessageData for MAG_CAL_REPORT_DATA {
19051 type Message = MavMessage;
19052 const ID: u32 = 192u32;
19053 const NAME: &'static str = "MAG_CAL_REPORT";
19054 const EXTRA_CRC: u8 = 36u8;
19055 const ENCODED_LEN: usize = 54usize;
19056 fn deser(
19057 _version: MavlinkVersion,
19058 __input: &[u8],
19059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19060 let avail_len = __input.len();
19061 let mut payload_buf = [0; Self::ENCODED_LEN];
19062 let mut buf = if avail_len < Self::ENCODED_LEN {
19063 payload_buf[0..avail_len].copy_from_slice(__input);
19064 Bytes::new(&payload_buf)
19065 } else {
19066 Bytes::new(__input)
19067 };
19068 let mut __struct = Self::default();
19069 __struct.fitness = buf.get_f32_le();
19070 __struct.ofs_x = buf.get_f32_le();
19071 __struct.ofs_y = buf.get_f32_le();
19072 __struct.ofs_z = buf.get_f32_le();
19073 __struct.diag_x = buf.get_f32_le();
19074 __struct.diag_y = buf.get_f32_le();
19075 __struct.diag_z = buf.get_f32_le();
19076 __struct.offdiag_x = buf.get_f32_le();
19077 __struct.offdiag_y = buf.get_f32_le();
19078 __struct.offdiag_z = buf.get_f32_le();
19079 __struct.compass_id = buf.get_u8();
19080 __struct.cal_mask = buf.get_u8();
19081 let tmp = buf.get_u8();
19082 __struct.cal_status =
19083 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19084 enum_type: "MagCalStatus",
19085 value: tmp as u32,
19086 })?;
19087 __struct.autosaved = buf.get_u8();
19088 __struct.orientation_confidence = buf.get_f32_le();
19089 let tmp = buf.get_u8();
19090 __struct.old_orientation =
19091 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19092 enum_type: "MavSensorOrientation",
19093 value: tmp as u32,
19094 })?;
19095 let tmp = buf.get_u8();
19096 __struct.new_orientation =
19097 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19098 enum_type: "MavSensorOrientation",
19099 value: tmp as u32,
19100 })?;
19101 __struct.scale_factor = buf.get_f32_le();
19102 Ok(__struct)
19103 }
19104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19105 let mut __tmp = BytesMut::new(bytes);
19106 #[allow(clippy::absurd_extreme_comparisons)]
19107 #[allow(unused_comparisons)]
19108 if __tmp.remaining() < Self::ENCODED_LEN {
19109 panic!(
19110 "buffer is too small (need {} bytes, but got {})",
19111 Self::ENCODED_LEN,
19112 __tmp.remaining(),
19113 )
19114 }
19115 __tmp.put_f32_le(self.fitness);
19116 __tmp.put_f32_le(self.ofs_x);
19117 __tmp.put_f32_le(self.ofs_y);
19118 __tmp.put_f32_le(self.ofs_z);
19119 __tmp.put_f32_le(self.diag_x);
19120 __tmp.put_f32_le(self.diag_y);
19121 __tmp.put_f32_le(self.diag_z);
19122 __tmp.put_f32_le(self.offdiag_x);
19123 __tmp.put_f32_le(self.offdiag_y);
19124 __tmp.put_f32_le(self.offdiag_z);
19125 __tmp.put_u8(self.compass_id);
19126 __tmp.put_u8(self.cal_mask);
19127 __tmp.put_u8(self.cal_status as u8);
19128 __tmp.put_u8(self.autosaved);
19129 if matches!(version, MavlinkVersion::V2) {
19130 __tmp.put_f32_le(self.orientation_confidence);
19131 __tmp.put_u8(self.old_orientation as u8);
19132 __tmp.put_u8(self.new_orientation as u8);
19133 __tmp.put_f32_le(self.scale_factor);
19134 let len = __tmp.len();
19135 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19136 } else {
19137 __tmp.len()
19138 }
19139 }
19140}
19141#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19142#[doc = ""]
19143#[doc = "ID: 69"]
19144#[derive(Debug, Clone, PartialEq)]
19145#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19146#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19147#[cfg_attr(feature = "ts", derive(TS))]
19148#[cfg_attr(feature = "ts", ts(export))]
19149pub struct MANUAL_CONTROL_DATA {
19150 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19151 pub x: i16,
19152 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19153 pub y: i16,
19154 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19155 pub z: i16,
19156 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19157 pub r: i16,
19158 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19159 pub buttons: u16,
19160 #[doc = "The system to be controlled."]
19161 pub target: u8,
19162 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19164 pub buttons2: u16,
19165 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19167 pub enabled_extensions: u8,
19168 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19169 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19170 pub s: i16,
19171 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19172 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19173 pub t: i16,
19174 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19175 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19176 pub aux1: i16,
19177 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19178 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19179 pub aux2: i16,
19180 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19181 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19182 pub aux3: i16,
19183 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19184 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19185 pub aux4: i16,
19186 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19187 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19188 pub aux5: i16,
19189 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19190 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19191 pub aux6: i16,
19192}
19193impl MANUAL_CONTROL_DATA {
19194 pub const ENCODED_LEN: usize = 30usize;
19195 pub const DEFAULT: Self = Self {
19196 x: 0_i16,
19197 y: 0_i16,
19198 z: 0_i16,
19199 r: 0_i16,
19200 buttons: 0_u16,
19201 target: 0_u8,
19202 buttons2: 0_u16,
19203 enabled_extensions: 0_u8,
19204 s: 0_i16,
19205 t: 0_i16,
19206 aux1: 0_i16,
19207 aux2: 0_i16,
19208 aux3: 0_i16,
19209 aux4: 0_i16,
19210 aux5: 0_i16,
19211 aux6: 0_i16,
19212 };
19213 #[cfg(feature = "arbitrary")]
19214 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19215 use arbitrary::{Arbitrary, Unstructured};
19216 let mut buf = [0u8; 1024];
19217 rng.fill_bytes(&mut buf);
19218 let mut unstructured = Unstructured::new(&buf);
19219 Self::arbitrary(&mut unstructured).unwrap_or_default()
19220 }
19221}
19222impl Default for MANUAL_CONTROL_DATA {
19223 fn default() -> Self {
19224 Self::DEFAULT.clone()
19225 }
19226}
19227impl MessageData for MANUAL_CONTROL_DATA {
19228 type Message = MavMessage;
19229 const ID: u32 = 69u32;
19230 const NAME: &'static str = "MANUAL_CONTROL";
19231 const EXTRA_CRC: u8 = 243u8;
19232 const ENCODED_LEN: usize = 30usize;
19233 fn deser(
19234 _version: MavlinkVersion,
19235 __input: &[u8],
19236 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19237 let avail_len = __input.len();
19238 let mut payload_buf = [0; Self::ENCODED_LEN];
19239 let mut buf = if avail_len < Self::ENCODED_LEN {
19240 payload_buf[0..avail_len].copy_from_slice(__input);
19241 Bytes::new(&payload_buf)
19242 } else {
19243 Bytes::new(__input)
19244 };
19245 let mut __struct = Self::default();
19246 __struct.x = buf.get_i16_le();
19247 __struct.y = buf.get_i16_le();
19248 __struct.z = buf.get_i16_le();
19249 __struct.r = buf.get_i16_le();
19250 __struct.buttons = buf.get_u16_le();
19251 __struct.target = buf.get_u8();
19252 __struct.buttons2 = buf.get_u16_le();
19253 __struct.enabled_extensions = buf.get_u8();
19254 __struct.s = buf.get_i16_le();
19255 __struct.t = buf.get_i16_le();
19256 __struct.aux1 = buf.get_i16_le();
19257 __struct.aux2 = buf.get_i16_le();
19258 __struct.aux3 = buf.get_i16_le();
19259 __struct.aux4 = buf.get_i16_le();
19260 __struct.aux5 = buf.get_i16_le();
19261 __struct.aux6 = buf.get_i16_le();
19262 Ok(__struct)
19263 }
19264 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19265 let mut __tmp = BytesMut::new(bytes);
19266 #[allow(clippy::absurd_extreme_comparisons)]
19267 #[allow(unused_comparisons)]
19268 if __tmp.remaining() < Self::ENCODED_LEN {
19269 panic!(
19270 "buffer is too small (need {} bytes, but got {})",
19271 Self::ENCODED_LEN,
19272 __tmp.remaining(),
19273 )
19274 }
19275 __tmp.put_i16_le(self.x);
19276 __tmp.put_i16_le(self.y);
19277 __tmp.put_i16_le(self.z);
19278 __tmp.put_i16_le(self.r);
19279 __tmp.put_u16_le(self.buttons);
19280 __tmp.put_u8(self.target);
19281 if matches!(version, MavlinkVersion::V2) {
19282 __tmp.put_u16_le(self.buttons2);
19283 __tmp.put_u8(self.enabled_extensions);
19284 __tmp.put_i16_le(self.s);
19285 __tmp.put_i16_le(self.t);
19286 __tmp.put_i16_le(self.aux1);
19287 __tmp.put_i16_le(self.aux2);
19288 __tmp.put_i16_le(self.aux3);
19289 __tmp.put_i16_le(self.aux4);
19290 __tmp.put_i16_le(self.aux5);
19291 __tmp.put_i16_le(self.aux6);
19292 let len = __tmp.len();
19293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19294 } else {
19295 __tmp.len()
19296 }
19297 }
19298}
19299#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19300#[doc = ""]
19301#[doc = "ID: 81"]
19302#[derive(Debug, Clone, PartialEq)]
19303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19305#[cfg_attr(feature = "ts", derive(TS))]
19306#[cfg_attr(feature = "ts", ts(export))]
19307pub struct MANUAL_SETPOINT_DATA {
19308 #[doc = "Timestamp (time since system boot)."]
19309 pub time_boot_ms: u32,
19310 #[doc = "Desired roll rate"]
19311 pub roll: f32,
19312 #[doc = "Desired pitch rate"]
19313 pub pitch: f32,
19314 #[doc = "Desired yaw rate"]
19315 pub yaw: f32,
19316 #[doc = "Collective thrust, normalized to 0 .. 1"]
19317 pub thrust: f32,
19318 #[doc = "Flight mode switch position, 0.. 255"]
19319 pub mode_switch: u8,
19320 #[doc = "Override mode switch position, 0.. 255"]
19321 pub manual_override_switch: u8,
19322}
19323impl MANUAL_SETPOINT_DATA {
19324 pub const ENCODED_LEN: usize = 22usize;
19325 pub const DEFAULT: Self = Self {
19326 time_boot_ms: 0_u32,
19327 roll: 0.0_f32,
19328 pitch: 0.0_f32,
19329 yaw: 0.0_f32,
19330 thrust: 0.0_f32,
19331 mode_switch: 0_u8,
19332 manual_override_switch: 0_u8,
19333 };
19334 #[cfg(feature = "arbitrary")]
19335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19336 use arbitrary::{Arbitrary, Unstructured};
19337 let mut buf = [0u8; 1024];
19338 rng.fill_bytes(&mut buf);
19339 let mut unstructured = Unstructured::new(&buf);
19340 Self::arbitrary(&mut unstructured).unwrap_or_default()
19341 }
19342}
19343impl Default for MANUAL_SETPOINT_DATA {
19344 fn default() -> Self {
19345 Self::DEFAULT.clone()
19346 }
19347}
19348impl MessageData for MANUAL_SETPOINT_DATA {
19349 type Message = MavMessage;
19350 const ID: u32 = 81u32;
19351 const NAME: &'static str = "MANUAL_SETPOINT";
19352 const EXTRA_CRC: u8 = 106u8;
19353 const ENCODED_LEN: usize = 22usize;
19354 fn deser(
19355 _version: MavlinkVersion,
19356 __input: &[u8],
19357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19358 let avail_len = __input.len();
19359 let mut payload_buf = [0; Self::ENCODED_LEN];
19360 let mut buf = if avail_len < Self::ENCODED_LEN {
19361 payload_buf[0..avail_len].copy_from_slice(__input);
19362 Bytes::new(&payload_buf)
19363 } else {
19364 Bytes::new(__input)
19365 };
19366 let mut __struct = Self::default();
19367 __struct.time_boot_ms = buf.get_u32_le();
19368 __struct.roll = buf.get_f32_le();
19369 __struct.pitch = buf.get_f32_le();
19370 __struct.yaw = buf.get_f32_le();
19371 __struct.thrust = buf.get_f32_le();
19372 __struct.mode_switch = buf.get_u8();
19373 __struct.manual_override_switch = buf.get_u8();
19374 Ok(__struct)
19375 }
19376 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19377 let mut __tmp = BytesMut::new(bytes);
19378 #[allow(clippy::absurd_extreme_comparisons)]
19379 #[allow(unused_comparisons)]
19380 if __tmp.remaining() < Self::ENCODED_LEN {
19381 panic!(
19382 "buffer is too small (need {} bytes, but got {})",
19383 Self::ENCODED_LEN,
19384 __tmp.remaining(),
19385 )
19386 }
19387 __tmp.put_u32_le(self.time_boot_ms);
19388 __tmp.put_f32_le(self.roll);
19389 __tmp.put_f32_le(self.pitch);
19390 __tmp.put_f32_le(self.yaw);
19391 __tmp.put_f32_le(self.thrust);
19392 __tmp.put_u8(self.mode_switch);
19393 __tmp.put_u8(self.manual_override_switch);
19394 if matches!(version, MavlinkVersion::V2) {
19395 let len = __tmp.len();
19396 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19397 } else {
19398 __tmp.len()
19399 }
19400 }
19401}
19402#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19403#[doc = ""]
19404#[doc = "ID: 249"]
19405#[derive(Debug, Clone, PartialEq)]
19406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19408#[cfg_attr(feature = "ts", derive(TS))]
19409#[cfg_attr(feature = "ts", ts(export))]
19410pub struct MEMORY_VECT_DATA {
19411 #[doc = "Starting address of the debug variables"]
19412 pub address: u16,
19413 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19414 pub ver: u8,
19415 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19416 pub mavtype: u8,
19417 #[doc = "Memory contents at specified address"]
19418 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19419 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19420 pub value: [i8; 32],
19421}
19422impl MEMORY_VECT_DATA {
19423 pub const ENCODED_LEN: usize = 36usize;
19424 pub const DEFAULT: Self = Self {
19425 address: 0_u16,
19426 ver: 0_u8,
19427 mavtype: 0_u8,
19428 value: [0_i8; 32usize],
19429 };
19430 #[cfg(feature = "arbitrary")]
19431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19432 use arbitrary::{Arbitrary, Unstructured};
19433 let mut buf = [0u8; 1024];
19434 rng.fill_bytes(&mut buf);
19435 let mut unstructured = Unstructured::new(&buf);
19436 Self::arbitrary(&mut unstructured).unwrap_or_default()
19437 }
19438}
19439impl Default for MEMORY_VECT_DATA {
19440 fn default() -> Self {
19441 Self::DEFAULT.clone()
19442 }
19443}
19444impl MessageData for MEMORY_VECT_DATA {
19445 type Message = MavMessage;
19446 const ID: u32 = 249u32;
19447 const NAME: &'static str = "MEMORY_VECT";
19448 const EXTRA_CRC: u8 = 204u8;
19449 const ENCODED_LEN: usize = 36usize;
19450 fn deser(
19451 _version: MavlinkVersion,
19452 __input: &[u8],
19453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19454 let avail_len = __input.len();
19455 let mut payload_buf = [0; Self::ENCODED_LEN];
19456 let mut buf = if avail_len < Self::ENCODED_LEN {
19457 payload_buf[0..avail_len].copy_from_slice(__input);
19458 Bytes::new(&payload_buf)
19459 } else {
19460 Bytes::new(__input)
19461 };
19462 let mut __struct = Self::default();
19463 __struct.address = buf.get_u16_le();
19464 __struct.ver = buf.get_u8();
19465 __struct.mavtype = buf.get_u8();
19466 for v in &mut __struct.value {
19467 let val = buf.get_i8();
19468 *v = val;
19469 }
19470 Ok(__struct)
19471 }
19472 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19473 let mut __tmp = BytesMut::new(bytes);
19474 #[allow(clippy::absurd_extreme_comparisons)]
19475 #[allow(unused_comparisons)]
19476 if __tmp.remaining() < Self::ENCODED_LEN {
19477 panic!(
19478 "buffer is too small (need {} bytes, but got {})",
19479 Self::ENCODED_LEN,
19480 __tmp.remaining(),
19481 )
19482 }
19483 __tmp.put_u16_le(self.address);
19484 __tmp.put_u8(self.ver);
19485 __tmp.put_u8(self.mavtype);
19486 for val in &self.value {
19487 __tmp.put_i8(*val);
19488 }
19489 if matches!(version, MavlinkVersion::V2) {
19490 let len = __tmp.len();
19491 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19492 } else {
19493 __tmp.len()
19494 }
19495 }
19496}
19497#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19498#[doc = ""]
19499#[doc = "ID: 244"]
19500#[derive(Debug, Clone, PartialEq)]
19501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19503#[cfg_attr(feature = "ts", derive(TS))]
19504#[cfg_attr(feature = "ts", ts(export))]
19505pub struct MESSAGE_INTERVAL_DATA {
19506 #[doc = "0 indicates the interval at which it is sent."]
19507 pub interval_us: i32,
19508 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19509 pub message_id: u16,
19510}
19511impl MESSAGE_INTERVAL_DATA {
19512 pub const ENCODED_LEN: usize = 6usize;
19513 pub const DEFAULT: Self = Self {
19514 interval_us: 0_i32,
19515 message_id: 0_u16,
19516 };
19517 #[cfg(feature = "arbitrary")]
19518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19519 use arbitrary::{Arbitrary, Unstructured};
19520 let mut buf = [0u8; 1024];
19521 rng.fill_bytes(&mut buf);
19522 let mut unstructured = Unstructured::new(&buf);
19523 Self::arbitrary(&mut unstructured).unwrap_or_default()
19524 }
19525}
19526impl Default for MESSAGE_INTERVAL_DATA {
19527 fn default() -> Self {
19528 Self::DEFAULT.clone()
19529 }
19530}
19531impl MessageData for MESSAGE_INTERVAL_DATA {
19532 type Message = MavMessage;
19533 const ID: u32 = 244u32;
19534 const NAME: &'static str = "MESSAGE_INTERVAL";
19535 const EXTRA_CRC: u8 = 95u8;
19536 const ENCODED_LEN: usize = 6usize;
19537 fn deser(
19538 _version: MavlinkVersion,
19539 __input: &[u8],
19540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19541 let avail_len = __input.len();
19542 let mut payload_buf = [0; Self::ENCODED_LEN];
19543 let mut buf = if avail_len < Self::ENCODED_LEN {
19544 payload_buf[0..avail_len].copy_from_slice(__input);
19545 Bytes::new(&payload_buf)
19546 } else {
19547 Bytes::new(__input)
19548 };
19549 let mut __struct = Self::default();
19550 __struct.interval_us = buf.get_i32_le();
19551 __struct.message_id = buf.get_u16_le();
19552 Ok(__struct)
19553 }
19554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19555 let mut __tmp = BytesMut::new(bytes);
19556 #[allow(clippy::absurd_extreme_comparisons)]
19557 #[allow(unused_comparisons)]
19558 if __tmp.remaining() < Self::ENCODED_LEN {
19559 panic!(
19560 "buffer is too small (need {} bytes, but got {})",
19561 Self::ENCODED_LEN,
19562 __tmp.remaining(),
19563 )
19564 }
19565 __tmp.put_i32_le(self.interval_us);
19566 __tmp.put_u16_le(self.message_id);
19567 if matches!(version, MavlinkVersion::V2) {
19568 let len = __tmp.len();
19569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19570 } else {
19571 __tmp.len()
19572 }
19573 }
19574}
19575#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19576#[doc = ""]
19577#[doc = "ID: 47"]
19578#[derive(Debug, Clone, PartialEq)]
19579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19581#[cfg_attr(feature = "ts", derive(TS))]
19582#[cfg_attr(feature = "ts", ts(export))]
19583pub struct MISSION_ACK_DATA {
19584 #[doc = "System ID"]
19585 pub target_system: u8,
19586 #[doc = "Component ID"]
19587 pub target_component: u8,
19588 #[doc = "Mission result."]
19589 pub mavtype: MavMissionResult,
19590 #[doc = "Mission type."]
19591 #[cfg_attr(feature = "serde", serde(default))]
19592 pub mission_type: MavMissionType,
19593 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19594 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19595 pub opaque_id: u32,
19596}
19597impl MISSION_ACK_DATA {
19598 pub const ENCODED_LEN: usize = 8usize;
19599 pub const DEFAULT: Self = Self {
19600 target_system: 0_u8,
19601 target_component: 0_u8,
19602 mavtype: MavMissionResult::DEFAULT,
19603 mission_type: MavMissionType::DEFAULT,
19604 opaque_id: 0_u32,
19605 };
19606 #[cfg(feature = "arbitrary")]
19607 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19608 use arbitrary::{Arbitrary, Unstructured};
19609 let mut buf = [0u8; 1024];
19610 rng.fill_bytes(&mut buf);
19611 let mut unstructured = Unstructured::new(&buf);
19612 Self::arbitrary(&mut unstructured).unwrap_or_default()
19613 }
19614}
19615impl Default for MISSION_ACK_DATA {
19616 fn default() -> Self {
19617 Self::DEFAULT.clone()
19618 }
19619}
19620impl MessageData for MISSION_ACK_DATA {
19621 type Message = MavMessage;
19622 const ID: u32 = 47u32;
19623 const NAME: &'static str = "MISSION_ACK";
19624 const EXTRA_CRC: u8 = 153u8;
19625 const ENCODED_LEN: usize = 8usize;
19626 fn deser(
19627 _version: MavlinkVersion,
19628 __input: &[u8],
19629 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19630 let avail_len = __input.len();
19631 let mut payload_buf = [0; Self::ENCODED_LEN];
19632 let mut buf = if avail_len < Self::ENCODED_LEN {
19633 payload_buf[0..avail_len].copy_from_slice(__input);
19634 Bytes::new(&payload_buf)
19635 } else {
19636 Bytes::new(__input)
19637 };
19638 let mut __struct = Self::default();
19639 __struct.target_system = buf.get_u8();
19640 __struct.target_component = buf.get_u8();
19641 let tmp = buf.get_u8();
19642 __struct.mavtype =
19643 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19644 enum_type: "MavMissionResult",
19645 value: tmp as u32,
19646 })?;
19647 let tmp = buf.get_u8();
19648 __struct.mission_type =
19649 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19650 enum_type: "MavMissionType",
19651 value: tmp as u32,
19652 })?;
19653 __struct.opaque_id = buf.get_u32_le();
19654 Ok(__struct)
19655 }
19656 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19657 let mut __tmp = BytesMut::new(bytes);
19658 #[allow(clippy::absurd_extreme_comparisons)]
19659 #[allow(unused_comparisons)]
19660 if __tmp.remaining() < Self::ENCODED_LEN {
19661 panic!(
19662 "buffer is too small (need {} bytes, but got {})",
19663 Self::ENCODED_LEN,
19664 __tmp.remaining(),
19665 )
19666 }
19667 __tmp.put_u8(self.target_system);
19668 __tmp.put_u8(self.target_component);
19669 __tmp.put_u8(self.mavtype as u8);
19670 if matches!(version, MavlinkVersion::V2) {
19671 __tmp.put_u8(self.mission_type as u8);
19672 __tmp.put_u32_le(self.opaque_id);
19673 let len = __tmp.len();
19674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19675 } else {
19676 __tmp.len()
19677 }
19678 }
19679}
19680#[doc = "Delete all mission items at once."]
19681#[doc = ""]
19682#[doc = "ID: 45"]
19683#[derive(Debug, Clone, PartialEq)]
19684#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19685#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19686#[cfg_attr(feature = "ts", derive(TS))]
19687#[cfg_attr(feature = "ts", ts(export))]
19688pub struct MISSION_CLEAR_ALL_DATA {
19689 #[doc = "System ID"]
19690 pub target_system: u8,
19691 #[doc = "Component ID"]
19692 pub target_component: u8,
19693 #[doc = "Mission type."]
19694 #[cfg_attr(feature = "serde", serde(default))]
19695 pub mission_type: MavMissionType,
19696}
19697impl MISSION_CLEAR_ALL_DATA {
19698 pub const ENCODED_LEN: usize = 3usize;
19699 pub const DEFAULT: Self = Self {
19700 target_system: 0_u8,
19701 target_component: 0_u8,
19702 mission_type: MavMissionType::DEFAULT,
19703 };
19704 #[cfg(feature = "arbitrary")]
19705 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19706 use arbitrary::{Arbitrary, Unstructured};
19707 let mut buf = [0u8; 1024];
19708 rng.fill_bytes(&mut buf);
19709 let mut unstructured = Unstructured::new(&buf);
19710 Self::arbitrary(&mut unstructured).unwrap_or_default()
19711 }
19712}
19713impl Default for MISSION_CLEAR_ALL_DATA {
19714 fn default() -> Self {
19715 Self::DEFAULT.clone()
19716 }
19717}
19718impl MessageData for MISSION_CLEAR_ALL_DATA {
19719 type Message = MavMessage;
19720 const ID: u32 = 45u32;
19721 const NAME: &'static str = "MISSION_CLEAR_ALL";
19722 const EXTRA_CRC: u8 = 232u8;
19723 const ENCODED_LEN: usize = 3usize;
19724 fn deser(
19725 _version: MavlinkVersion,
19726 __input: &[u8],
19727 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19728 let avail_len = __input.len();
19729 let mut payload_buf = [0; Self::ENCODED_LEN];
19730 let mut buf = if avail_len < Self::ENCODED_LEN {
19731 payload_buf[0..avail_len].copy_from_slice(__input);
19732 Bytes::new(&payload_buf)
19733 } else {
19734 Bytes::new(__input)
19735 };
19736 let mut __struct = Self::default();
19737 __struct.target_system = buf.get_u8();
19738 __struct.target_component = buf.get_u8();
19739 let tmp = buf.get_u8();
19740 __struct.mission_type =
19741 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19742 enum_type: "MavMissionType",
19743 value: tmp as u32,
19744 })?;
19745 Ok(__struct)
19746 }
19747 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19748 let mut __tmp = BytesMut::new(bytes);
19749 #[allow(clippy::absurd_extreme_comparisons)]
19750 #[allow(unused_comparisons)]
19751 if __tmp.remaining() < Self::ENCODED_LEN {
19752 panic!(
19753 "buffer is too small (need {} bytes, but got {})",
19754 Self::ENCODED_LEN,
19755 __tmp.remaining(),
19756 )
19757 }
19758 __tmp.put_u8(self.target_system);
19759 __tmp.put_u8(self.target_component);
19760 if matches!(version, MavlinkVersion::V2) {
19761 __tmp.put_u8(self.mission_type as u8);
19762 let len = __tmp.len();
19763 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19764 } else {
19765 __tmp.len()
19766 }
19767 }
19768}
19769#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19770#[doc = ""]
19771#[doc = "ID: 44"]
19772#[derive(Debug, Clone, PartialEq)]
19773#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19775#[cfg_attr(feature = "ts", derive(TS))]
19776#[cfg_attr(feature = "ts", ts(export))]
19777pub struct MISSION_COUNT_DATA {
19778 #[doc = "Number of mission items in the sequence"]
19779 pub count: u16,
19780 #[doc = "System ID"]
19781 pub target_system: u8,
19782 #[doc = "Component ID"]
19783 pub target_component: u8,
19784 #[doc = "Mission type."]
19785 #[cfg_attr(feature = "serde", serde(default))]
19786 pub mission_type: MavMissionType,
19787 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19788 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19789 pub opaque_id: u32,
19790}
19791impl MISSION_COUNT_DATA {
19792 pub const ENCODED_LEN: usize = 9usize;
19793 pub const DEFAULT: Self = Self {
19794 count: 0_u16,
19795 target_system: 0_u8,
19796 target_component: 0_u8,
19797 mission_type: MavMissionType::DEFAULT,
19798 opaque_id: 0_u32,
19799 };
19800 #[cfg(feature = "arbitrary")]
19801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19802 use arbitrary::{Arbitrary, Unstructured};
19803 let mut buf = [0u8; 1024];
19804 rng.fill_bytes(&mut buf);
19805 let mut unstructured = Unstructured::new(&buf);
19806 Self::arbitrary(&mut unstructured).unwrap_or_default()
19807 }
19808}
19809impl Default for MISSION_COUNT_DATA {
19810 fn default() -> Self {
19811 Self::DEFAULT.clone()
19812 }
19813}
19814impl MessageData for MISSION_COUNT_DATA {
19815 type Message = MavMessage;
19816 const ID: u32 = 44u32;
19817 const NAME: &'static str = "MISSION_COUNT";
19818 const EXTRA_CRC: u8 = 221u8;
19819 const ENCODED_LEN: usize = 9usize;
19820 fn deser(
19821 _version: MavlinkVersion,
19822 __input: &[u8],
19823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19824 let avail_len = __input.len();
19825 let mut payload_buf = [0; Self::ENCODED_LEN];
19826 let mut buf = if avail_len < Self::ENCODED_LEN {
19827 payload_buf[0..avail_len].copy_from_slice(__input);
19828 Bytes::new(&payload_buf)
19829 } else {
19830 Bytes::new(__input)
19831 };
19832 let mut __struct = Self::default();
19833 __struct.count = buf.get_u16_le();
19834 __struct.target_system = buf.get_u8();
19835 __struct.target_component = buf.get_u8();
19836 let tmp = buf.get_u8();
19837 __struct.mission_type =
19838 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19839 enum_type: "MavMissionType",
19840 value: tmp as u32,
19841 })?;
19842 __struct.opaque_id = buf.get_u32_le();
19843 Ok(__struct)
19844 }
19845 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19846 let mut __tmp = BytesMut::new(bytes);
19847 #[allow(clippy::absurd_extreme_comparisons)]
19848 #[allow(unused_comparisons)]
19849 if __tmp.remaining() < Self::ENCODED_LEN {
19850 panic!(
19851 "buffer is too small (need {} bytes, but got {})",
19852 Self::ENCODED_LEN,
19853 __tmp.remaining(),
19854 )
19855 }
19856 __tmp.put_u16_le(self.count);
19857 __tmp.put_u8(self.target_system);
19858 __tmp.put_u8(self.target_component);
19859 if matches!(version, MavlinkVersion::V2) {
19860 __tmp.put_u8(self.mission_type as u8);
19861 __tmp.put_u32_le(self.opaque_id);
19862 let len = __tmp.len();
19863 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19864 } else {
19865 __tmp.len()
19866 }
19867 }
19868}
19869#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19870#[doc = ""]
19871#[doc = "ID: 42"]
19872#[derive(Debug, Clone, PartialEq)]
19873#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19875#[cfg_attr(feature = "ts", derive(TS))]
19876#[cfg_attr(feature = "ts", ts(export))]
19877pub struct MISSION_CURRENT_DATA {
19878 #[doc = "Sequence"]
19879 pub seq: u16,
19880 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19881 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19882 pub total: u16,
19883 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19884 #[cfg_attr(feature = "serde", serde(default))]
19885 pub mission_state: MissionState,
19886 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19887 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19888 pub mission_mode: u8,
19889 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19891 pub mission_id: u32,
19892 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19893 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19894 pub fence_id: u32,
19895 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19896 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19897 pub rally_points_id: u32,
19898}
19899impl MISSION_CURRENT_DATA {
19900 pub const ENCODED_LEN: usize = 18usize;
19901 pub const DEFAULT: Self = Self {
19902 seq: 0_u16,
19903 total: 0_u16,
19904 mission_state: MissionState::DEFAULT,
19905 mission_mode: 0_u8,
19906 mission_id: 0_u32,
19907 fence_id: 0_u32,
19908 rally_points_id: 0_u32,
19909 };
19910 #[cfg(feature = "arbitrary")]
19911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19912 use arbitrary::{Arbitrary, Unstructured};
19913 let mut buf = [0u8; 1024];
19914 rng.fill_bytes(&mut buf);
19915 let mut unstructured = Unstructured::new(&buf);
19916 Self::arbitrary(&mut unstructured).unwrap_or_default()
19917 }
19918}
19919impl Default for MISSION_CURRENT_DATA {
19920 fn default() -> Self {
19921 Self::DEFAULT.clone()
19922 }
19923}
19924impl MessageData for MISSION_CURRENT_DATA {
19925 type Message = MavMessage;
19926 const ID: u32 = 42u32;
19927 const NAME: &'static str = "MISSION_CURRENT";
19928 const EXTRA_CRC: u8 = 28u8;
19929 const ENCODED_LEN: usize = 18usize;
19930 fn deser(
19931 _version: MavlinkVersion,
19932 __input: &[u8],
19933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19934 let avail_len = __input.len();
19935 let mut payload_buf = [0; Self::ENCODED_LEN];
19936 let mut buf = if avail_len < Self::ENCODED_LEN {
19937 payload_buf[0..avail_len].copy_from_slice(__input);
19938 Bytes::new(&payload_buf)
19939 } else {
19940 Bytes::new(__input)
19941 };
19942 let mut __struct = Self::default();
19943 __struct.seq = buf.get_u16_le();
19944 __struct.total = buf.get_u16_le();
19945 let tmp = buf.get_u8();
19946 __struct.mission_state =
19947 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19948 enum_type: "MissionState",
19949 value: tmp as u32,
19950 })?;
19951 __struct.mission_mode = buf.get_u8();
19952 __struct.mission_id = buf.get_u32_le();
19953 __struct.fence_id = buf.get_u32_le();
19954 __struct.rally_points_id = buf.get_u32_le();
19955 Ok(__struct)
19956 }
19957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19958 let mut __tmp = BytesMut::new(bytes);
19959 #[allow(clippy::absurd_extreme_comparisons)]
19960 #[allow(unused_comparisons)]
19961 if __tmp.remaining() < Self::ENCODED_LEN {
19962 panic!(
19963 "buffer is too small (need {} bytes, but got {})",
19964 Self::ENCODED_LEN,
19965 __tmp.remaining(),
19966 )
19967 }
19968 __tmp.put_u16_le(self.seq);
19969 if matches!(version, MavlinkVersion::V2) {
19970 __tmp.put_u16_le(self.total);
19971 __tmp.put_u8(self.mission_state as u8);
19972 __tmp.put_u8(self.mission_mode);
19973 __tmp.put_u32_le(self.mission_id);
19974 __tmp.put_u32_le(self.fence_id);
19975 __tmp.put_u32_le(self.rally_points_id);
19976 let len = __tmp.len();
19977 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19978 } else {
19979 __tmp.len()
19980 }
19981 }
19982}
19983#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19984#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19985#[doc = ""]
19986#[doc = "ID: 39"]
19987#[derive(Debug, Clone, PartialEq)]
19988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19990#[cfg_attr(feature = "ts", derive(TS))]
19991#[cfg_attr(feature = "ts", ts(export))]
19992pub struct MISSION_ITEM_DATA {
19993 #[doc = "PARAM1, see MAV_CMD enum"]
19994 pub param1: f32,
19995 #[doc = "PARAM2, see MAV_CMD enum"]
19996 pub param2: f32,
19997 #[doc = "PARAM3, see MAV_CMD enum"]
19998 pub param3: f32,
19999 #[doc = "PARAM4, see MAV_CMD enum"]
20000 pub param4: f32,
20001 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20002 pub x: f32,
20003 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20004 pub y: f32,
20005 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20006 pub z: f32,
20007 #[doc = "Sequence"]
20008 pub seq: u16,
20009 #[doc = "The scheduled action for the waypoint."]
20010 pub command: MavCmd,
20011 #[doc = "System ID"]
20012 pub target_system: u8,
20013 #[doc = "Component ID"]
20014 pub target_component: u8,
20015 #[doc = "The coordinate system of the waypoint."]
20016 pub frame: MavFrame,
20017 #[doc = "false:0, true:1"]
20018 pub current: u8,
20019 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20020 pub autocontinue: u8,
20021 #[doc = "Mission type."]
20022 #[cfg_attr(feature = "serde", serde(default))]
20023 pub mission_type: MavMissionType,
20024}
20025impl MISSION_ITEM_DATA {
20026 pub const ENCODED_LEN: usize = 38usize;
20027 pub const DEFAULT: Self = Self {
20028 param1: 0.0_f32,
20029 param2: 0.0_f32,
20030 param3: 0.0_f32,
20031 param4: 0.0_f32,
20032 x: 0.0_f32,
20033 y: 0.0_f32,
20034 z: 0.0_f32,
20035 seq: 0_u16,
20036 command: MavCmd::DEFAULT,
20037 target_system: 0_u8,
20038 target_component: 0_u8,
20039 frame: MavFrame::DEFAULT,
20040 current: 0_u8,
20041 autocontinue: 0_u8,
20042 mission_type: MavMissionType::DEFAULT,
20043 };
20044 #[cfg(feature = "arbitrary")]
20045 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20046 use arbitrary::{Arbitrary, Unstructured};
20047 let mut buf = [0u8; 1024];
20048 rng.fill_bytes(&mut buf);
20049 let mut unstructured = Unstructured::new(&buf);
20050 Self::arbitrary(&mut unstructured).unwrap_or_default()
20051 }
20052}
20053impl Default for MISSION_ITEM_DATA {
20054 fn default() -> Self {
20055 Self::DEFAULT.clone()
20056 }
20057}
20058impl MessageData for MISSION_ITEM_DATA {
20059 type Message = MavMessage;
20060 const ID: u32 = 39u32;
20061 const NAME: &'static str = "MISSION_ITEM";
20062 const EXTRA_CRC: u8 = 254u8;
20063 const ENCODED_LEN: usize = 38usize;
20064 fn deser(
20065 _version: MavlinkVersion,
20066 __input: &[u8],
20067 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20068 let avail_len = __input.len();
20069 let mut payload_buf = [0; Self::ENCODED_LEN];
20070 let mut buf = if avail_len < Self::ENCODED_LEN {
20071 payload_buf[0..avail_len].copy_from_slice(__input);
20072 Bytes::new(&payload_buf)
20073 } else {
20074 Bytes::new(__input)
20075 };
20076 let mut __struct = Self::default();
20077 __struct.param1 = buf.get_f32_le();
20078 __struct.param2 = buf.get_f32_le();
20079 __struct.param3 = buf.get_f32_le();
20080 __struct.param4 = buf.get_f32_le();
20081 __struct.x = buf.get_f32_le();
20082 __struct.y = buf.get_f32_le();
20083 __struct.z = buf.get_f32_le();
20084 __struct.seq = buf.get_u16_le();
20085 let tmp = buf.get_u16_le();
20086 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20087 ::mavlink_core::error::ParserError::InvalidEnum {
20088 enum_type: "MavCmd",
20089 value: tmp as u32,
20090 },
20091 )?;
20092 __struct.target_system = buf.get_u8();
20093 __struct.target_component = buf.get_u8();
20094 let tmp = buf.get_u8();
20095 __struct.frame =
20096 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20097 enum_type: "MavFrame",
20098 value: tmp as u32,
20099 })?;
20100 __struct.current = buf.get_u8();
20101 __struct.autocontinue = buf.get_u8();
20102 let tmp = buf.get_u8();
20103 __struct.mission_type =
20104 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20105 enum_type: "MavMissionType",
20106 value: tmp as u32,
20107 })?;
20108 Ok(__struct)
20109 }
20110 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20111 let mut __tmp = BytesMut::new(bytes);
20112 #[allow(clippy::absurd_extreme_comparisons)]
20113 #[allow(unused_comparisons)]
20114 if __tmp.remaining() < Self::ENCODED_LEN {
20115 panic!(
20116 "buffer is too small (need {} bytes, but got {})",
20117 Self::ENCODED_LEN,
20118 __tmp.remaining(),
20119 )
20120 }
20121 __tmp.put_f32_le(self.param1);
20122 __tmp.put_f32_le(self.param2);
20123 __tmp.put_f32_le(self.param3);
20124 __tmp.put_f32_le(self.param4);
20125 __tmp.put_f32_le(self.x);
20126 __tmp.put_f32_le(self.y);
20127 __tmp.put_f32_le(self.z);
20128 __tmp.put_u16_le(self.seq);
20129 __tmp.put_u16_le(self.command as u16);
20130 __tmp.put_u8(self.target_system);
20131 __tmp.put_u8(self.target_component);
20132 __tmp.put_u8(self.frame as u8);
20133 __tmp.put_u8(self.current);
20134 __tmp.put_u8(self.autocontinue);
20135 if matches!(version, MavlinkVersion::V2) {
20136 __tmp.put_u8(self.mission_type as u8);
20137 let len = __tmp.len();
20138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20139 } else {
20140 __tmp.len()
20141 }
20142 }
20143}
20144#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20145#[doc = ""]
20146#[doc = "ID: 73"]
20147#[derive(Debug, Clone, PartialEq)]
20148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20150#[cfg_attr(feature = "ts", derive(TS))]
20151#[cfg_attr(feature = "ts", ts(export))]
20152pub struct MISSION_ITEM_INT_DATA {
20153 #[doc = "PARAM1, see MAV_CMD enum"]
20154 pub param1: f32,
20155 #[doc = "PARAM2, see MAV_CMD enum"]
20156 pub param2: f32,
20157 #[doc = "PARAM3, see MAV_CMD enum"]
20158 pub param3: f32,
20159 #[doc = "PARAM4, see MAV_CMD enum"]
20160 pub param4: f32,
20161 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20162 pub x: i32,
20163 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20164 pub y: i32,
20165 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20166 pub z: f32,
20167 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20168 pub seq: u16,
20169 #[doc = "The scheduled action for the waypoint."]
20170 pub command: MavCmd,
20171 #[doc = "System ID"]
20172 pub target_system: u8,
20173 #[doc = "Component ID"]
20174 pub target_component: u8,
20175 #[doc = "The coordinate system of the waypoint."]
20176 pub frame: MavFrame,
20177 #[doc = "false:0, true:1"]
20178 pub current: u8,
20179 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20180 pub autocontinue: u8,
20181 #[doc = "Mission type."]
20182 #[cfg_attr(feature = "serde", serde(default))]
20183 pub mission_type: MavMissionType,
20184}
20185impl MISSION_ITEM_INT_DATA {
20186 pub const ENCODED_LEN: usize = 38usize;
20187 pub const DEFAULT: Self = Self {
20188 param1: 0.0_f32,
20189 param2: 0.0_f32,
20190 param3: 0.0_f32,
20191 param4: 0.0_f32,
20192 x: 0_i32,
20193 y: 0_i32,
20194 z: 0.0_f32,
20195 seq: 0_u16,
20196 command: MavCmd::DEFAULT,
20197 target_system: 0_u8,
20198 target_component: 0_u8,
20199 frame: MavFrame::DEFAULT,
20200 current: 0_u8,
20201 autocontinue: 0_u8,
20202 mission_type: MavMissionType::DEFAULT,
20203 };
20204 #[cfg(feature = "arbitrary")]
20205 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20206 use arbitrary::{Arbitrary, Unstructured};
20207 let mut buf = [0u8; 1024];
20208 rng.fill_bytes(&mut buf);
20209 let mut unstructured = Unstructured::new(&buf);
20210 Self::arbitrary(&mut unstructured).unwrap_or_default()
20211 }
20212}
20213impl Default for MISSION_ITEM_INT_DATA {
20214 fn default() -> Self {
20215 Self::DEFAULT.clone()
20216 }
20217}
20218impl MessageData for MISSION_ITEM_INT_DATA {
20219 type Message = MavMessage;
20220 const ID: u32 = 73u32;
20221 const NAME: &'static str = "MISSION_ITEM_INT";
20222 const EXTRA_CRC: u8 = 38u8;
20223 const ENCODED_LEN: usize = 38usize;
20224 fn deser(
20225 _version: MavlinkVersion,
20226 __input: &[u8],
20227 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20228 let avail_len = __input.len();
20229 let mut payload_buf = [0; Self::ENCODED_LEN];
20230 let mut buf = if avail_len < Self::ENCODED_LEN {
20231 payload_buf[0..avail_len].copy_from_slice(__input);
20232 Bytes::new(&payload_buf)
20233 } else {
20234 Bytes::new(__input)
20235 };
20236 let mut __struct = Self::default();
20237 __struct.param1 = buf.get_f32_le();
20238 __struct.param2 = buf.get_f32_le();
20239 __struct.param3 = buf.get_f32_le();
20240 __struct.param4 = buf.get_f32_le();
20241 __struct.x = buf.get_i32_le();
20242 __struct.y = buf.get_i32_le();
20243 __struct.z = buf.get_f32_le();
20244 __struct.seq = buf.get_u16_le();
20245 let tmp = buf.get_u16_le();
20246 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20247 ::mavlink_core::error::ParserError::InvalidEnum {
20248 enum_type: "MavCmd",
20249 value: tmp as u32,
20250 },
20251 )?;
20252 __struct.target_system = buf.get_u8();
20253 __struct.target_component = buf.get_u8();
20254 let tmp = buf.get_u8();
20255 __struct.frame =
20256 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20257 enum_type: "MavFrame",
20258 value: tmp as u32,
20259 })?;
20260 __struct.current = buf.get_u8();
20261 __struct.autocontinue = buf.get_u8();
20262 let tmp = buf.get_u8();
20263 __struct.mission_type =
20264 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20265 enum_type: "MavMissionType",
20266 value: tmp as u32,
20267 })?;
20268 Ok(__struct)
20269 }
20270 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20271 let mut __tmp = BytesMut::new(bytes);
20272 #[allow(clippy::absurd_extreme_comparisons)]
20273 #[allow(unused_comparisons)]
20274 if __tmp.remaining() < Self::ENCODED_LEN {
20275 panic!(
20276 "buffer is too small (need {} bytes, but got {})",
20277 Self::ENCODED_LEN,
20278 __tmp.remaining(),
20279 )
20280 }
20281 __tmp.put_f32_le(self.param1);
20282 __tmp.put_f32_le(self.param2);
20283 __tmp.put_f32_le(self.param3);
20284 __tmp.put_f32_le(self.param4);
20285 __tmp.put_i32_le(self.x);
20286 __tmp.put_i32_le(self.y);
20287 __tmp.put_f32_le(self.z);
20288 __tmp.put_u16_le(self.seq);
20289 __tmp.put_u16_le(self.command as u16);
20290 __tmp.put_u8(self.target_system);
20291 __tmp.put_u8(self.target_component);
20292 __tmp.put_u8(self.frame as u8);
20293 __tmp.put_u8(self.current);
20294 __tmp.put_u8(self.autocontinue);
20295 if matches!(version, MavlinkVersion::V2) {
20296 __tmp.put_u8(self.mission_type as u8);
20297 let len = __tmp.len();
20298 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20299 } else {
20300 __tmp.len()
20301 }
20302 }
20303}
20304#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20305#[doc = ""]
20306#[doc = "ID: 46"]
20307#[derive(Debug, Clone, PartialEq)]
20308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20310#[cfg_attr(feature = "ts", derive(TS))]
20311#[cfg_attr(feature = "ts", ts(export))]
20312pub struct MISSION_ITEM_REACHED_DATA {
20313 #[doc = "Sequence"]
20314 pub seq: u16,
20315}
20316impl MISSION_ITEM_REACHED_DATA {
20317 pub const ENCODED_LEN: usize = 2usize;
20318 pub const DEFAULT: Self = Self { seq: 0_u16 };
20319 #[cfg(feature = "arbitrary")]
20320 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20321 use arbitrary::{Arbitrary, Unstructured};
20322 let mut buf = [0u8; 1024];
20323 rng.fill_bytes(&mut buf);
20324 let mut unstructured = Unstructured::new(&buf);
20325 Self::arbitrary(&mut unstructured).unwrap_or_default()
20326 }
20327}
20328impl Default for MISSION_ITEM_REACHED_DATA {
20329 fn default() -> Self {
20330 Self::DEFAULT.clone()
20331 }
20332}
20333impl MessageData for MISSION_ITEM_REACHED_DATA {
20334 type Message = MavMessage;
20335 const ID: u32 = 46u32;
20336 const NAME: &'static str = "MISSION_ITEM_REACHED";
20337 const EXTRA_CRC: u8 = 11u8;
20338 const ENCODED_LEN: usize = 2usize;
20339 fn deser(
20340 _version: MavlinkVersion,
20341 __input: &[u8],
20342 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20343 let avail_len = __input.len();
20344 let mut payload_buf = [0; Self::ENCODED_LEN];
20345 let mut buf = if avail_len < Self::ENCODED_LEN {
20346 payload_buf[0..avail_len].copy_from_slice(__input);
20347 Bytes::new(&payload_buf)
20348 } else {
20349 Bytes::new(__input)
20350 };
20351 let mut __struct = Self::default();
20352 __struct.seq = buf.get_u16_le();
20353 Ok(__struct)
20354 }
20355 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20356 let mut __tmp = BytesMut::new(bytes);
20357 #[allow(clippy::absurd_extreme_comparisons)]
20358 #[allow(unused_comparisons)]
20359 if __tmp.remaining() < Self::ENCODED_LEN {
20360 panic!(
20361 "buffer is too small (need {} bytes, but got {})",
20362 Self::ENCODED_LEN,
20363 __tmp.remaining(),
20364 )
20365 }
20366 __tmp.put_u16_le(self.seq);
20367 if matches!(version, MavlinkVersion::V2) {
20368 let len = __tmp.len();
20369 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20370 } else {
20371 __tmp.len()
20372 }
20373 }
20374}
20375#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20376#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20377#[doc = ""]
20378#[doc = "ID: 40"]
20379#[derive(Debug, Clone, PartialEq)]
20380#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20381#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20382#[cfg_attr(feature = "ts", derive(TS))]
20383#[cfg_attr(feature = "ts", ts(export))]
20384pub struct MISSION_REQUEST_DATA {
20385 #[doc = "Sequence"]
20386 pub seq: u16,
20387 #[doc = "System ID"]
20388 pub target_system: u8,
20389 #[doc = "Component ID"]
20390 pub target_component: u8,
20391 #[doc = "Mission type."]
20392 #[cfg_attr(feature = "serde", serde(default))]
20393 pub mission_type: MavMissionType,
20394}
20395impl MISSION_REQUEST_DATA {
20396 pub const ENCODED_LEN: usize = 5usize;
20397 pub const DEFAULT: Self = Self {
20398 seq: 0_u16,
20399 target_system: 0_u8,
20400 target_component: 0_u8,
20401 mission_type: MavMissionType::DEFAULT,
20402 };
20403 #[cfg(feature = "arbitrary")]
20404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20405 use arbitrary::{Arbitrary, Unstructured};
20406 let mut buf = [0u8; 1024];
20407 rng.fill_bytes(&mut buf);
20408 let mut unstructured = Unstructured::new(&buf);
20409 Self::arbitrary(&mut unstructured).unwrap_or_default()
20410 }
20411}
20412impl Default for MISSION_REQUEST_DATA {
20413 fn default() -> Self {
20414 Self::DEFAULT.clone()
20415 }
20416}
20417impl MessageData for MISSION_REQUEST_DATA {
20418 type Message = MavMessage;
20419 const ID: u32 = 40u32;
20420 const NAME: &'static str = "MISSION_REQUEST";
20421 const EXTRA_CRC: u8 = 230u8;
20422 const ENCODED_LEN: usize = 5usize;
20423 fn deser(
20424 _version: MavlinkVersion,
20425 __input: &[u8],
20426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20427 let avail_len = __input.len();
20428 let mut payload_buf = [0; Self::ENCODED_LEN];
20429 let mut buf = if avail_len < Self::ENCODED_LEN {
20430 payload_buf[0..avail_len].copy_from_slice(__input);
20431 Bytes::new(&payload_buf)
20432 } else {
20433 Bytes::new(__input)
20434 };
20435 let mut __struct = Self::default();
20436 __struct.seq = buf.get_u16_le();
20437 __struct.target_system = buf.get_u8();
20438 __struct.target_component = buf.get_u8();
20439 let tmp = buf.get_u8();
20440 __struct.mission_type =
20441 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20442 enum_type: "MavMissionType",
20443 value: tmp as u32,
20444 })?;
20445 Ok(__struct)
20446 }
20447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20448 let mut __tmp = BytesMut::new(bytes);
20449 #[allow(clippy::absurd_extreme_comparisons)]
20450 #[allow(unused_comparisons)]
20451 if __tmp.remaining() < Self::ENCODED_LEN {
20452 panic!(
20453 "buffer is too small (need {} bytes, but got {})",
20454 Self::ENCODED_LEN,
20455 __tmp.remaining(),
20456 )
20457 }
20458 __tmp.put_u16_le(self.seq);
20459 __tmp.put_u8(self.target_system);
20460 __tmp.put_u8(self.target_component);
20461 if matches!(version, MavlinkVersion::V2) {
20462 __tmp.put_u8(self.mission_type as u8);
20463 let len = __tmp.len();
20464 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20465 } else {
20466 __tmp.len()
20467 }
20468 }
20469}
20470#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20471#[doc = ""]
20472#[doc = "ID: 51"]
20473#[derive(Debug, Clone, PartialEq)]
20474#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20476#[cfg_attr(feature = "ts", derive(TS))]
20477#[cfg_attr(feature = "ts", ts(export))]
20478pub struct MISSION_REQUEST_INT_DATA {
20479 #[doc = "Sequence"]
20480 pub seq: u16,
20481 #[doc = "System ID"]
20482 pub target_system: u8,
20483 #[doc = "Component ID"]
20484 pub target_component: u8,
20485 #[doc = "Mission type."]
20486 #[cfg_attr(feature = "serde", serde(default))]
20487 pub mission_type: MavMissionType,
20488}
20489impl MISSION_REQUEST_INT_DATA {
20490 pub const ENCODED_LEN: usize = 5usize;
20491 pub const DEFAULT: Self = Self {
20492 seq: 0_u16,
20493 target_system: 0_u8,
20494 target_component: 0_u8,
20495 mission_type: MavMissionType::DEFAULT,
20496 };
20497 #[cfg(feature = "arbitrary")]
20498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20499 use arbitrary::{Arbitrary, Unstructured};
20500 let mut buf = [0u8; 1024];
20501 rng.fill_bytes(&mut buf);
20502 let mut unstructured = Unstructured::new(&buf);
20503 Self::arbitrary(&mut unstructured).unwrap_or_default()
20504 }
20505}
20506impl Default for MISSION_REQUEST_INT_DATA {
20507 fn default() -> Self {
20508 Self::DEFAULT.clone()
20509 }
20510}
20511impl MessageData for MISSION_REQUEST_INT_DATA {
20512 type Message = MavMessage;
20513 const ID: u32 = 51u32;
20514 const NAME: &'static str = "MISSION_REQUEST_INT";
20515 const EXTRA_CRC: u8 = 196u8;
20516 const ENCODED_LEN: usize = 5usize;
20517 fn deser(
20518 _version: MavlinkVersion,
20519 __input: &[u8],
20520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20521 let avail_len = __input.len();
20522 let mut payload_buf = [0; Self::ENCODED_LEN];
20523 let mut buf = if avail_len < Self::ENCODED_LEN {
20524 payload_buf[0..avail_len].copy_from_slice(__input);
20525 Bytes::new(&payload_buf)
20526 } else {
20527 Bytes::new(__input)
20528 };
20529 let mut __struct = Self::default();
20530 __struct.seq = buf.get_u16_le();
20531 __struct.target_system = buf.get_u8();
20532 __struct.target_component = buf.get_u8();
20533 let tmp = buf.get_u8();
20534 __struct.mission_type =
20535 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20536 enum_type: "MavMissionType",
20537 value: tmp as u32,
20538 })?;
20539 Ok(__struct)
20540 }
20541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20542 let mut __tmp = BytesMut::new(bytes);
20543 #[allow(clippy::absurd_extreme_comparisons)]
20544 #[allow(unused_comparisons)]
20545 if __tmp.remaining() < Self::ENCODED_LEN {
20546 panic!(
20547 "buffer is too small (need {} bytes, but got {})",
20548 Self::ENCODED_LEN,
20549 __tmp.remaining(),
20550 )
20551 }
20552 __tmp.put_u16_le(self.seq);
20553 __tmp.put_u8(self.target_system);
20554 __tmp.put_u8(self.target_component);
20555 if matches!(version, MavlinkVersion::V2) {
20556 __tmp.put_u8(self.mission_type as u8);
20557 let len = __tmp.len();
20558 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20559 } else {
20560 __tmp.len()
20561 }
20562 }
20563}
20564#[doc = "Request the overall list of mission items from the system/component."]
20565#[doc = ""]
20566#[doc = "ID: 43"]
20567#[derive(Debug, Clone, PartialEq)]
20568#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20570#[cfg_attr(feature = "ts", derive(TS))]
20571#[cfg_attr(feature = "ts", ts(export))]
20572pub struct MISSION_REQUEST_LIST_DATA {
20573 #[doc = "System ID"]
20574 pub target_system: u8,
20575 #[doc = "Component ID"]
20576 pub target_component: u8,
20577 #[doc = "Mission type."]
20578 #[cfg_attr(feature = "serde", serde(default))]
20579 pub mission_type: MavMissionType,
20580}
20581impl MISSION_REQUEST_LIST_DATA {
20582 pub const ENCODED_LEN: usize = 3usize;
20583 pub const DEFAULT: Self = Self {
20584 target_system: 0_u8,
20585 target_component: 0_u8,
20586 mission_type: MavMissionType::DEFAULT,
20587 };
20588 #[cfg(feature = "arbitrary")]
20589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20590 use arbitrary::{Arbitrary, Unstructured};
20591 let mut buf = [0u8; 1024];
20592 rng.fill_bytes(&mut buf);
20593 let mut unstructured = Unstructured::new(&buf);
20594 Self::arbitrary(&mut unstructured).unwrap_or_default()
20595 }
20596}
20597impl Default for MISSION_REQUEST_LIST_DATA {
20598 fn default() -> Self {
20599 Self::DEFAULT.clone()
20600 }
20601}
20602impl MessageData for MISSION_REQUEST_LIST_DATA {
20603 type Message = MavMessage;
20604 const ID: u32 = 43u32;
20605 const NAME: &'static str = "MISSION_REQUEST_LIST";
20606 const EXTRA_CRC: u8 = 132u8;
20607 const ENCODED_LEN: usize = 3usize;
20608 fn deser(
20609 _version: MavlinkVersion,
20610 __input: &[u8],
20611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20612 let avail_len = __input.len();
20613 let mut payload_buf = [0; Self::ENCODED_LEN];
20614 let mut buf = if avail_len < Self::ENCODED_LEN {
20615 payload_buf[0..avail_len].copy_from_slice(__input);
20616 Bytes::new(&payload_buf)
20617 } else {
20618 Bytes::new(__input)
20619 };
20620 let mut __struct = Self::default();
20621 __struct.target_system = buf.get_u8();
20622 __struct.target_component = buf.get_u8();
20623 let tmp = buf.get_u8();
20624 __struct.mission_type =
20625 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20626 enum_type: "MavMissionType",
20627 value: tmp as u32,
20628 })?;
20629 Ok(__struct)
20630 }
20631 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20632 let mut __tmp = BytesMut::new(bytes);
20633 #[allow(clippy::absurd_extreme_comparisons)]
20634 #[allow(unused_comparisons)]
20635 if __tmp.remaining() < Self::ENCODED_LEN {
20636 panic!(
20637 "buffer is too small (need {} bytes, but got {})",
20638 Self::ENCODED_LEN,
20639 __tmp.remaining(),
20640 )
20641 }
20642 __tmp.put_u8(self.target_system);
20643 __tmp.put_u8(self.target_component);
20644 if matches!(version, MavlinkVersion::V2) {
20645 __tmp.put_u8(self.mission_type as u8);
20646 let len = __tmp.len();
20647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20648 } else {
20649 __tmp.len()
20650 }
20651 }
20652}
20653#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20654#[doc = ""]
20655#[doc = "ID: 37"]
20656#[derive(Debug, Clone, PartialEq)]
20657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20659#[cfg_attr(feature = "ts", derive(TS))]
20660#[cfg_attr(feature = "ts", ts(export))]
20661pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20662 #[doc = "Start index"]
20663 pub start_index: i16,
20664 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20665 pub end_index: i16,
20666 #[doc = "System ID"]
20667 pub target_system: u8,
20668 #[doc = "Component ID"]
20669 pub target_component: u8,
20670 #[doc = "Mission type."]
20671 #[cfg_attr(feature = "serde", serde(default))]
20672 pub mission_type: MavMissionType,
20673}
20674impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20675 pub const ENCODED_LEN: usize = 7usize;
20676 pub const DEFAULT: Self = Self {
20677 start_index: 0_i16,
20678 end_index: 0_i16,
20679 target_system: 0_u8,
20680 target_component: 0_u8,
20681 mission_type: MavMissionType::DEFAULT,
20682 };
20683 #[cfg(feature = "arbitrary")]
20684 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20685 use arbitrary::{Arbitrary, Unstructured};
20686 let mut buf = [0u8; 1024];
20687 rng.fill_bytes(&mut buf);
20688 let mut unstructured = Unstructured::new(&buf);
20689 Self::arbitrary(&mut unstructured).unwrap_or_default()
20690 }
20691}
20692impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20693 fn default() -> Self {
20694 Self::DEFAULT.clone()
20695 }
20696}
20697impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20698 type Message = MavMessage;
20699 const ID: u32 = 37u32;
20700 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20701 const EXTRA_CRC: u8 = 212u8;
20702 const ENCODED_LEN: usize = 7usize;
20703 fn deser(
20704 _version: MavlinkVersion,
20705 __input: &[u8],
20706 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20707 let avail_len = __input.len();
20708 let mut payload_buf = [0; Self::ENCODED_LEN];
20709 let mut buf = if avail_len < Self::ENCODED_LEN {
20710 payload_buf[0..avail_len].copy_from_slice(__input);
20711 Bytes::new(&payload_buf)
20712 } else {
20713 Bytes::new(__input)
20714 };
20715 let mut __struct = Self::default();
20716 __struct.start_index = buf.get_i16_le();
20717 __struct.end_index = buf.get_i16_le();
20718 __struct.target_system = buf.get_u8();
20719 __struct.target_component = buf.get_u8();
20720 let tmp = buf.get_u8();
20721 __struct.mission_type =
20722 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20723 enum_type: "MavMissionType",
20724 value: tmp as u32,
20725 })?;
20726 Ok(__struct)
20727 }
20728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20729 let mut __tmp = BytesMut::new(bytes);
20730 #[allow(clippy::absurd_extreme_comparisons)]
20731 #[allow(unused_comparisons)]
20732 if __tmp.remaining() < Self::ENCODED_LEN {
20733 panic!(
20734 "buffer is too small (need {} bytes, but got {})",
20735 Self::ENCODED_LEN,
20736 __tmp.remaining(),
20737 )
20738 }
20739 __tmp.put_i16_le(self.start_index);
20740 __tmp.put_i16_le(self.end_index);
20741 __tmp.put_u8(self.target_system);
20742 __tmp.put_u8(self.target_component);
20743 if matches!(version, MavlinkVersion::V2) {
20744 __tmp.put_u8(self.mission_type as u8);
20745 let len = __tmp.len();
20746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20747 } else {
20748 __tmp.len()
20749 }
20750 }
20751}
20752#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20753#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20754#[doc = ""]
20755#[doc = "ID: 41"]
20756#[derive(Debug, Clone, PartialEq)]
20757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20759#[cfg_attr(feature = "ts", derive(TS))]
20760#[cfg_attr(feature = "ts", ts(export))]
20761pub struct MISSION_SET_CURRENT_DATA {
20762 #[doc = "Sequence"]
20763 pub seq: u16,
20764 #[doc = "System ID"]
20765 pub target_system: u8,
20766 #[doc = "Component ID"]
20767 pub target_component: u8,
20768}
20769impl MISSION_SET_CURRENT_DATA {
20770 pub const ENCODED_LEN: usize = 4usize;
20771 pub const DEFAULT: Self = Self {
20772 seq: 0_u16,
20773 target_system: 0_u8,
20774 target_component: 0_u8,
20775 };
20776 #[cfg(feature = "arbitrary")]
20777 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20778 use arbitrary::{Arbitrary, Unstructured};
20779 let mut buf = [0u8; 1024];
20780 rng.fill_bytes(&mut buf);
20781 let mut unstructured = Unstructured::new(&buf);
20782 Self::arbitrary(&mut unstructured).unwrap_or_default()
20783 }
20784}
20785impl Default for MISSION_SET_CURRENT_DATA {
20786 fn default() -> Self {
20787 Self::DEFAULT.clone()
20788 }
20789}
20790impl MessageData for MISSION_SET_CURRENT_DATA {
20791 type Message = MavMessage;
20792 const ID: u32 = 41u32;
20793 const NAME: &'static str = "MISSION_SET_CURRENT";
20794 const EXTRA_CRC: u8 = 28u8;
20795 const ENCODED_LEN: usize = 4usize;
20796 fn deser(
20797 _version: MavlinkVersion,
20798 __input: &[u8],
20799 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20800 let avail_len = __input.len();
20801 let mut payload_buf = [0; Self::ENCODED_LEN];
20802 let mut buf = if avail_len < Self::ENCODED_LEN {
20803 payload_buf[0..avail_len].copy_from_slice(__input);
20804 Bytes::new(&payload_buf)
20805 } else {
20806 Bytes::new(__input)
20807 };
20808 let mut __struct = Self::default();
20809 __struct.seq = buf.get_u16_le();
20810 __struct.target_system = buf.get_u8();
20811 __struct.target_component = buf.get_u8();
20812 Ok(__struct)
20813 }
20814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20815 let mut __tmp = BytesMut::new(bytes);
20816 #[allow(clippy::absurd_extreme_comparisons)]
20817 #[allow(unused_comparisons)]
20818 if __tmp.remaining() < Self::ENCODED_LEN {
20819 panic!(
20820 "buffer is too small (need {} bytes, but got {})",
20821 Self::ENCODED_LEN,
20822 __tmp.remaining(),
20823 )
20824 }
20825 __tmp.put_u16_le(self.seq);
20826 __tmp.put_u8(self.target_system);
20827 __tmp.put_u8(self.target_component);
20828 if matches!(version, MavlinkVersion::V2) {
20829 let len = __tmp.len();
20830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20831 } else {
20832 __tmp.len()
20833 }
20834 }
20835}
20836#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20837#[doc = ""]
20838#[doc = "ID: 38"]
20839#[derive(Debug, Clone, PartialEq)]
20840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20842#[cfg_attr(feature = "ts", derive(TS))]
20843#[cfg_attr(feature = "ts", ts(export))]
20844pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20845 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20846 pub start_index: i16,
20847 #[doc = "End index, equal or greater than start index."]
20848 pub end_index: i16,
20849 #[doc = "System ID"]
20850 pub target_system: u8,
20851 #[doc = "Component ID"]
20852 pub target_component: u8,
20853 #[doc = "Mission type."]
20854 #[cfg_attr(feature = "serde", serde(default))]
20855 pub mission_type: MavMissionType,
20856}
20857impl MISSION_WRITE_PARTIAL_LIST_DATA {
20858 pub const ENCODED_LEN: usize = 7usize;
20859 pub const DEFAULT: Self = Self {
20860 start_index: 0_i16,
20861 end_index: 0_i16,
20862 target_system: 0_u8,
20863 target_component: 0_u8,
20864 mission_type: MavMissionType::DEFAULT,
20865 };
20866 #[cfg(feature = "arbitrary")]
20867 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20868 use arbitrary::{Arbitrary, Unstructured};
20869 let mut buf = [0u8; 1024];
20870 rng.fill_bytes(&mut buf);
20871 let mut unstructured = Unstructured::new(&buf);
20872 Self::arbitrary(&mut unstructured).unwrap_or_default()
20873 }
20874}
20875impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20876 fn default() -> Self {
20877 Self::DEFAULT.clone()
20878 }
20879}
20880impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20881 type Message = MavMessage;
20882 const ID: u32 = 38u32;
20883 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20884 const EXTRA_CRC: u8 = 9u8;
20885 const ENCODED_LEN: usize = 7usize;
20886 fn deser(
20887 _version: MavlinkVersion,
20888 __input: &[u8],
20889 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20890 let avail_len = __input.len();
20891 let mut payload_buf = [0; Self::ENCODED_LEN];
20892 let mut buf = if avail_len < Self::ENCODED_LEN {
20893 payload_buf[0..avail_len].copy_from_slice(__input);
20894 Bytes::new(&payload_buf)
20895 } else {
20896 Bytes::new(__input)
20897 };
20898 let mut __struct = Self::default();
20899 __struct.start_index = buf.get_i16_le();
20900 __struct.end_index = buf.get_i16_le();
20901 __struct.target_system = buf.get_u8();
20902 __struct.target_component = buf.get_u8();
20903 let tmp = buf.get_u8();
20904 __struct.mission_type =
20905 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20906 enum_type: "MavMissionType",
20907 value: tmp as u32,
20908 })?;
20909 Ok(__struct)
20910 }
20911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20912 let mut __tmp = BytesMut::new(bytes);
20913 #[allow(clippy::absurd_extreme_comparisons)]
20914 #[allow(unused_comparisons)]
20915 if __tmp.remaining() < Self::ENCODED_LEN {
20916 panic!(
20917 "buffer is too small (need {} bytes, but got {})",
20918 Self::ENCODED_LEN,
20919 __tmp.remaining(),
20920 )
20921 }
20922 __tmp.put_i16_le(self.start_index);
20923 __tmp.put_i16_le(self.end_index);
20924 __tmp.put_u8(self.target_system);
20925 __tmp.put_u8(self.target_component);
20926 if matches!(version, MavlinkVersion::V2) {
20927 __tmp.put_u8(self.mission_type as u8);
20928 let len = __tmp.len();
20929 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20930 } else {
20931 __tmp.len()
20932 }
20933 }
20934}
20935#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20936#[doc = "Orientation of a mount."]
20937#[doc = ""]
20938#[doc = "ID: 265"]
20939#[derive(Debug, Clone, PartialEq)]
20940#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20941#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20942#[cfg_attr(feature = "ts", derive(TS))]
20943#[cfg_attr(feature = "ts", ts(export))]
20944pub struct MOUNT_ORIENTATION_DATA {
20945 #[doc = "Timestamp (time since system boot)."]
20946 pub time_boot_ms: u32,
20947 #[doc = "Roll in global frame (set to NaN for invalid)."]
20948 pub roll: f32,
20949 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20950 pub pitch: f32,
20951 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20952 pub yaw: f32,
20953 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20954 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20955 pub yaw_absolute: f32,
20956}
20957impl MOUNT_ORIENTATION_DATA {
20958 pub const ENCODED_LEN: usize = 20usize;
20959 pub const DEFAULT: Self = Self {
20960 time_boot_ms: 0_u32,
20961 roll: 0.0_f32,
20962 pitch: 0.0_f32,
20963 yaw: 0.0_f32,
20964 yaw_absolute: 0.0_f32,
20965 };
20966 #[cfg(feature = "arbitrary")]
20967 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20968 use arbitrary::{Arbitrary, Unstructured};
20969 let mut buf = [0u8; 1024];
20970 rng.fill_bytes(&mut buf);
20971 let mut unstructured = Unstructured::new(&buf);
20972 Self::arbitrary(&mut unstructured).unwrap_or_default()
20973 }
20974}
20975impl Default for MOUNT_ORIENTATION_DATA {
20976 fn default() -> Self {
20977 Self::DEFAULT.clone()
20978 }
20979}
20980impl MessageData for MOUNT_ORIENTATION_DATA {
20981 type Message = MavMessage;
20982 const ID: u32 = 265u32;
20983 const NAME: &'static str = "MOUNT_ORIENTATION";
20984 const EXTRA_CRC: u8 = 26u8;
20985 const ENCODED_LEN: usize = 20usize;
20986 fn deser(
20987 _version: MavlinkVersion,
20988 __input: &[u8],
20989 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20990 let avail_len = __input.len();
20991 let mut payload_buf = [0; Self::ENCODED_LEN];
20992 let mut buf = if avail_len < Self::ENCODED_LEN {
20993 payload_buf[0..avail_len].copy_from_slice(__input);
20994 Bytes::new(&payload_buf)
20995 } else {
20996 Bytes::new(__input)
20997 };
20998 let mut __struct = Self::default();
20999 __struct.time_boot_ms = buf.get_u32_le();
21000 __struct.roll = buf.get_f32_le();
21001 __struct.pitch = buf.get_f32_le();
21002 __struct.yaw = buf.get_f32_le();
21003 __struct.yaw_absolute = buf.get_f32_le();
21004 Ok(__struct)
21005 }
21006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21007 let mut __tmp = BytesMut::new(bytes);
21008 #[allow(clippy::absurd_extreme_comparisons)]
21009 #[allow(unused_comparisons)]
21010 if __tmp.remaining() < Self::ENCODED_LEN {
21011 panic!(
21012 "buffer is too small (need {} bytes, but got {})",
21013 Self::ENCODED_LEN,
21014 __tmp.remaining(),
21015 )
21016 }
21017 __tmp.put_u32_le(self.time_boot_ms);
21018 __tmp.put_f32_le(self.roll);
21019 __tmp.put_f32_le(self.pitch);
21020 __tmp.put_f32_le(self.yaw);
21021 if matches!(version, MavlinkVersion::V2) {
21022 __tmp.put_f32_le(self.yaw_absolute);
21023 let len = __tmp.len();
21024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21025 } else {
21026 __tmp.len()
21027 }
21028 }
21029}
21030#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21031#[doc = ""]
21032#[doc = "ID: 251"]
21033#[derive(Debug, Clone, PartialEq)]
21034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21036#[cfg_attr(feature = "ts", derive(TS))]
21037#[cfg_attr(feature = "ts", ts(export))]
21038pub struct NAMED_VALUE_FLOAT_DATA {
21039 #[doc = "Timestamp (time since system boot)."]
21040 pub time_boot_ms: u32,
21041 #[doc = "Floating point value"]
21042 pub value: f32,
21043 #[doc = "Name of the debug variable"]
21044 #[cfg_attr(feature = "ts", ts(type = "string"))]
21045 pub name: CharArray<10>,
21046}
21047impl NAMED_VALUE_FLOAT_DATA {
21048 pub const ENCODED_LEN: usize = 18usize;
21049 pub const DEFAULT: Self = Self {
21050 time_boot_ms: 0_u32,
21051 value: 0.0_f32,
21052 name: CharArray::new([0_u8; 10usize]),
21053 };
21054 #[cfg(feature = "arbitrary")]
21055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21056 use arbitrary::{Arbitrary, Unstructured};
21057 let mut buf = [0u8; 1024];
21058 rng.fill_bytes(&mut buf);
21059 let mut unstructured = Unstructured::new(&buf);
21060 Self::arbitrary(&mut unstructured).unwrap_or_default()
21061 }
21062}
21063impl Default for NAMED_VALUE_FLOAT_DATA {
21064 fn default() -> Self {
21065 Self::DEFAULT.clone()
21066 }
21067}
21068impl MessageData for NAMED_VALUE_FLOAT_DATA {
21069 type Message = MavMessage;
21070 const ID: u32 = 251u32;
21071 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21072 const EXTRA_CRC: u8 = 170u8;
21073 const ENCODED_LEN: usize = 18usize;
21074 fn deser(
21075 _version: MavlinkVersion,
21076 __input: &[u8],
21077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21078 let avail_len = __input.len();
21079 let mut payload_buf = [0; Self::ENCODED_LEN];
21080 let mut buf = if avail_len < Self::ENCODED_LEN {
21081 payload_buf[0..avail_len].copy_from_slice(__input);
21082 Bytes::new(&payload_buf)
21083 } else {
21084 Bytes::new(__input)
21085 };
21086 let mut __struct = Self::default();
21087 __struct.time_boot_ms = buf.get_u32_le();
21088 __struct.value = buf.get_f32_le();
21089 let mut tmp = [0_u8; 10usize];
21090 for v in &mut tmp {
21091 *v = buf.get_u8();
21092 }
21093 __struct.name = CharArray::new(tmp);
21094 Ok(__struct)
21095 }
21096 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21097 let mut __tmp = BytesMut::new(bytes);
21098 #[allow(clippy::absurd_extreme_comparisons)]
21099 #[allow(unused_comparisons)]
21100 if __tmp.remaining() < Self::ENCODED_LEN {
21101 panic!(
21102 "buffer is too small (need {} bytes, but got {})",
21103 Self::ENCODED_LEN,
21104 __tmp.remaining(),
21105 )
21106 }
21107 __tmp.put_u32_le(self.time_boot_ms);
21108 __tmp.put_f32_le(self.value);
21109 for val in &self.name {
21110 __tmp.put_u8(*val);
21111 }
21112 if matches!(version, MavlinkVersion::V2) {
21113 let len = __tmp.len();
21114 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21115 } else {
21116 __tmp.len()
21117 }
21118 }
21119}
21120#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21121#[doc = ""]
21122#[doc = "ID: 252"]
21123#[derive(Debug, Clone, PartialEq)]
21124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21126#[cfg_attr(feature = "ts", derive(TS))]
21127#[cfg_attr(feature = "ts", ts(export))]
21128pub struct NAMED_VALUE_INT_DATA {
21129 #[doc = "Timestamp (time since system boot)."]
21130 pub time_boot_ms: u32,
21131 #[doc = "Signed integer value"]
21132 pub value: i32,
21133 #[doc = "Name of the debug variable"]
21134 #[cfg_attr(feature = "ts", ts(type = "string"))]
21135 pub name: CharArray<10>,
21136}
21137impl NAMED_VALUE_INT_DATA {
21138 pub const ENCODED_LEN: usize = 18usize;
21139 pub const DEFAULT: Self = Self {
21140 time_boot_ms: 0_u32,
21141 value: 0_i32,
21142 name: CharArray::new([0_u8; 10usize]),
21143 };
21144 #[cfg(feature = "arbitrary")]
21145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21146 use arbitrary::{Arbitrary, Unstructured};
21147 let mut buf = [0u8; 1024];
21148 rng.fill_bytes(&mut buf);
21149 let mut unstructured = Unstructured::new(&buf);
21150 Self::arbitrary(&mut unstructured).unwrap_or_default()
21151 }
21152}
21153impl Default for NAMED_VALUE_INT_DATA {
21154 fn default() -> Self {
21155 Self::DEFAULT.clone()
21156 }
21157}
21158impl MessageData for NAMED_VALUE_INT_DATA {
21159 type Message = MavMessage;
21160 const ID: u32 = 252u32;
21161 const NAME: &'static str = "NAMED_VALUE_INT";
21162 const EXTRA_CRC: u8 = 44u8;
21163 const ENCODED_LEN: usize = 18usize;
21164 fn deser(
21165 _version: MavlinkVersion,
21166 __input: &[u8],
21167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21168 let avail_len = __input.len();
21169 let mut payload_buf = [0; Self::ENCODED_LEN];
21170 let mut buf = if avail_len < Self::ENCODED_LEN {
21171 payload_buf[0..avail_len].copy_from_slice(__input);
21172 Bytes::new(&payload_buf)
21173 } else {
21174 Bytes::new(__input)
21175 };
21176 let mut __struct = Self::default();
21177 __struct.time_boot_ms = buf.get_u32_le();
21178 __struct.value = buf.get_i32_le();
21179 let mut tmp = [0_u8; 10usize];
21180 for v in &mut tmp {
21181 *v = buf.get_u8();
21182 }
21183 __struct.name = CharArray::new(tmp);
21184 Ok(__struct)
21185 }
21186 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21187 let mut __tmp = BytesMut::new(bytes);
21188 #[allow(clippy::absurd_extreme_comparisons)]
21189 #[allow(unused_comparisons)]
21190 if __tmp.remaining() < Self::ENCODED_LEN {
21191 panic!(
21192 "buffer is too small (need {} bytes, but got {})",
21193 Self::ENCODED_LEN,
21194 __tmp.remaining(),
21195 )
21196 }
21197 __tmp.put_u32_le(self.time_boot_ms);
21198 __tmp.put_i32_le(self.value);
21199 for val in &self.name {
21200 __tmp.put_u8(*val);
21201 }
21202 if matches!(version, MavlinkVersion::V2) {
21203 let len = __tmp.len();
21204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21205 } else {
21206 __tmp.len()
21207 }
21208 }
21209}
21210#[doc = "The state of the navigation and position controller."]
21211#[doc = ""]
21212#[doc = "ID: 62"]
21213#[derive(Debug, Clone, PartialEq)]
21214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21216#[cfg_attr(feature = "ts", derive(TS))]
21217#[cfg_attr(feature = "ts", ts(export))]
21218pub struct NAV_CONTROLLER_OUTPUT_DATA {
21219 #[doc = "Current desired roll"]
21220 pub nav_roll: f32,
21221 #[doc = "Current desired pitch"]
21222 pub nav_pitch: f32,
21223 #[doc = "Current altitude error"]
21224 pub alt_error: f32,
21225 #[doc = "Current airspeed error"]
21226 pub aspd_error: f32,
21227 #[doc = "Current crosstrack error on x-y plane"]
21228 pub xtrack_error: f32,
21229 #[doc = "Current desired heading"]
21230 pub nav_bearing: i16,
21231 #[doc = "Bearing to current waypoint/target"]
21232 pub target_bearing: i16,
21233 #[doc = "Distance to active waypoint"]
21234 pub wp_dist: u16,
21235}
21236impl NAV_CONTROLLER_OUTPUT_DATA {
21237 pub const ENCODED_LEN: usize = 26usize;
21238 pub const DEFAULT: Self = Self {
21239 nav_roll: 0.0_f32,
21240 nav_pitch: 0.0_f32,
21241 alt_error: 0.0_f32,
21242 aspd_error: 0.0_f32,
21243 xtrack_error: 0.0_f32,
21244 nav_bearing: 0_i16,
21245 target_bearing: 0_i16,
21246 wp_dist: 0_u16,
21247 };
21248 #[cfg(feature = "arbitrary")]
21249 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21250 use arbitrary::{Arbitrary, Unstructured};
21251 let mut buf = [0u8; 1024];
21252 rng.fill_bytes(&mut buf);
21253 let mut unstructured = Unstructured::new(&buf);
21254 Self::arbitrary(&mut unstructured).unwrap_or_default()
21255 }
21256}
21257impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21258 fn default() -> Self {
21259 Self::DEFAULT.clone()
21260 }
21261}
21262impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21263 type Message = MavMessage;
21264 const ID: u32 = 62u32;
21265 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21266 const EXTRA_CRC: u8 = 183u8;
21267 const ENCODED_LEN: usize = 26usize;
21268 fn deser(
21269 _version: MavlinkVersion,
21270 __input: &[u8],
21271 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21272 let avail_len = __input.len();
21273 let mut payload_buf = [0; Self::ENCODED_LEN];
21274 let mut buf = if avail_len < Self::ENCODED_LEN {
21275 payload_buf[0..avail_len].copy_from_slice(__input);
21276 Bytes::new(&payload_buf)
21277 } else {
21278 Bytes::new(__input)
21279 };
21280 let mut __struct = Self::default();
21281 __struct.nav_roll = buf.get_f32_le();
21282 __struct.nav_pitch = buf.get_f32_le();
21283 __struct.alt_error = buf.get_f32_le();
21284 __struct.aspd_error = buf.get_f32_le();
21285 __struct.xtrack_error = buf.get_f32_le();
21286 __struct.nav_bearing = buf.get_i16_le();
21287 __struct.target_bearing = buf.get_i16_le();
21288 __struct.wp_dist = buf.get_u16_le();
21289 Ok(__struct)
21290 }
21291 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21292 let mut __tmp = BytesMut::new(bytes);
21293 #[allow(clippy::absurd_extreme_comparisons)]
21294 #[allow(unused_comparisons)]
21295 if __tmp.remaining() < Self::ENCODED_LEN {
21296 panic!(
21297 "buffer is too small (need {} bytes, but got {})",
21298 Self::ENCODED_LEN,
21299 __tmp.remaining(),
21300 )
21301 }
21302 __tmp.put_f32_le(self.nav_roll);
21303 __tmp.put_f32_le(self.nav_pitch);
21304 __tmp.put_f32_le(self.alt_error);
21305 __tmp.put_f32_le(self.aspd_error);
21306 __tmp.put_f32_le(self.xtrack_error);
21307 __tmp.put_i16_le(self.nav_bearing);
21308 __tmp.put_i16_le(self.target_bearing);
21309 __tmp.put_u16_le(self.wp_dist);
21310 if matches!(version, MavlinkVersion::V2) {
21311 let len = __tmp.len();
21312 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21313 } else {
21314 __tmp.len()
21315 }
21316 }
21317}
21318#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21319#[doc = ""]
21320#[doc = "ID: 330"]
21321#[derive(Debug, Clone, PartialEq)]
21322#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21323#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21324#[cfg_attr(feature = "ts", derive(TS))]
21325#[cfg_attr(feature = "ts", ts(export))]
21326pub struct OBSTACLE_DISTANCE_DATA {
21327 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21328 pub time_usec: u64,
21329 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21330 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21331 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21332 pub distances: [u16; 72],
21333 #[doc = "Minimum distance the sensor can measure."]
21334 pub min_distance: u16,
21335 #[doc = "Maximum distance the sensor can measure."]
21336 pub max_distance: u16,
21337 #[doc = "Class id of the distance sensor type."]
21338 pub sensor_type: MavDistanceSensor,
21339 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21340 pub increment: u8,
21341 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21342 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21343 pub increment_f: f32,
21344 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21345 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21346 pub angle_offset: f32,
21347 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21348 #[cfg_attr(feature = "serde", serde(default))]
21349 pub frame: MavFrame,
21350}
21351impl OBSTACLE_DISTANCE_DATA {
21352 pub const ENCODED_LEN: usize = 167usize;
21353 pub const DEFAULT: Self = Self {
21354 time_usec: 0_u64,
21355 distances: [0_u16; 72usize],
21356 min_distance: 0_u16,
21357 max_distance: 0_u16,
21358 sensor_type: MavDistanceSensor::DEFAULT,
21359 increment: 0_u8,
21360 increment_f: 0.0_f32,
21361 angle_offset: 0.0_f32,
21362 frame: MavFrame::DEFAULT,
21363 };
21364 #[cfg(feature = "arbitrary")]
21365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21366 use arbitrary::{Arbitrary, Unstructured};
21367 let mut buf = [0u8; 1024];
21368 rng.fill_bytes(&mut buf);
21369 let mut unstructured = Unstructured::new(&buf);
21370 Self::arbitrary(&mut unstructured).unwrap_or_default()
21371 }
21372}
21373impl Default for OBSTACLE_DISTANCE_DATA {
21374 fn default() -> Self {
21375 Self::DEFAULT.clone()
21376 }
21377}
21378impl MessageData for OBSTACLE_DISTANCE_DATA {
21379 type Message = MavMessage;
21380 const ID: u32 = 330u32;
21381 const NAME: &'static str = "OBSTACLE_DISTANCE";
21382 const EXTRA_CRC: u8 = 23u8;
21383 const ENCODED_LEN: usize = 167usize;
21384 fn deser(
21385 _version: MavlinkVersion,
21386 __input: &[u8],
21387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21388 let avail_len = __input.len();
21389 let mut payload_buf = [0; Self::ENCODED_LEN];
21390 let mut buf = if avail_len < Self::ENCODED_LEN {
21391 payload_buf[0..avail_len].copy_from_slice(__input);
21392 Bytes::new(&payload_buf)
21393 } else {
21394 Bytes::new(__input)
21395 };
21396 let mut __struct = Self::default();
21397 __struct.time_usec = buf.get_u64_le();
21398 for v in &mut __struct.distances {
21399 let val = buf.get_u16_le();
21400 *v = val;
21401 }
21402 __struct.min_distance = buf.get_u16_le();
21403 __struct.max_distance = buf.get_u16_le();
21404 let tmp = buf.get_u8();
21405 __struct.sensor_type =
21406 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21407 enum_type: "MavDistanceSensor",
21408 value: tmp as u32,
21409 })?;
21410 __struct.increment = buf.get_u8();
21411 __struct.increment_f = buf.get_f32_le();
21412 __struct.angle_offset = buf.get_f32_le();
21413 let tmp = buf.get_u8();
21414 __struct.frame =
21415 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21416 enum_type: "MavFrame",
21417 value: tmp as u32,
21418 })?;
21419 Ok(__struct)
21420 }
21421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21422 let mut __tmp = BytesMut::new(bytes);
21423 #[allow(clippy::absurd_extreme_comparisons)]
21424 #[allow(unused_comparisons)]
21425 if __tmp.remaining() < Self::ENCODED_LEN {
21426 panic!(
21427 "buffer is too small (need {} bytes, but got {})",
21428 Self::ENCODED_LEN,
21429 __tmp.remaining(),
21430 )
21431 }
21432 __tmp.put_u64_le(self.time_usec);
21433 for val in &self.distances {
21434 __tmp.put_u16_le(*val);
21435 }
21436 __tmp.put_u16_le(self.min_distance);
21437 __tmp.put_u16_le(self.max_distance);
21438 __tmp.put_u8(self.sensor_type as u8);
21439 __tmp.put_u8(self.increment);
21440 if matches!(version, MavlinkVersion::V2) {
21441 __tmp.put_f32_le(self.increment_f);
21442 __tmp.put_f32_le(self.angle_offset);
21443 __tmp.put_u8(self.frame as u8);
21444 let len = __tmp.len();
21445 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21446 } else {
21447 __tmp.len()
21448 }
21449 }
21450}
21451#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21452#[doc = ""]
21453#[doc = "ID: 331"]
21454#[derive(Debug, Clone, PartialEq)]
21455#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21456#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21457#[cfg_attr(feature = "ts", derive(TS))]
21458#[cfg_attr(feature = "ts", ts(export))]
21459pub struct ODOMETRY_DATA {
21460 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21461 pub time_usec: u64,
21462 #[doc = "X Position"]
21463 pub x: f32,
21464 #[doc = "Y Position"]
21465 pub y: f32,
21466 #[doc = "Z Position"]
21467 pub z: f32,
21468 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21469 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21470 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21471 pub q: [f32; 4],
21472 #[doc = "X linear speed"]
21473 pub vx: f32,
21474 #[doc = "Y linear speed"]
21475 pub vy: f32,
21476 #[doc = "Z linear speed"]
21477 pub vz: f32,
21478 #[doc = "Roll angular speed"]
21479 pub rollspeed: f32,
21480 #[doc = "Pitch angular speed"]
21481 pub pitchspeed: f32,
21482 #[doc = "Yaw angular speed"]
21483 pub yawspeed: f32,
21484 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21486 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21487 pub pose_covariance: [f32; 21],
21488 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21489 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21490 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21491 pub velocity_covariance: [f32; 21],
21492 #[doc = "Coordinate frame of reference for the pose data."]
21493 pub frame_id: MavFrame,
21494 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21495 pub child_frame_id: MavFrame,
21496 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21497 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21498 pub reset_counter: u8,
21499 #[doc = "Type of estimator that is providing the odometry."]
21500 #[cfg_attr(feature = "serde", serde(default))]
21501 pub estimator_type: MavEstimatorType,
21502 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21503 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21504 pub quality: i8,
21505}
21506impl ODOMETRY_DATA {
21507 pub const ENCODED_LEN: usize = 233usize;
21508 pub const DEFAULT: Self = Self {
21509 time_usec: 0_u64,
21510 x: 0.0_f32,
21511 y: 0.0_f32,
21512 z: 0.0_f32,
21513 q: [0.0_f32; 4usize],
21514 vx: 0.0_f32,
21515 vy: 0.0_f32,
21516 vz: 0.0_f32,
21517 rollspeed: 0.0_f32,
21518 pitchspeed: 0.0_f32,
21519 yawspeed: 0.0_f32,
21520 pose_covariance: [0.0_f32; 21usize],
21521 velocity_covariance: [0.0_f32; 21usize],
21522 frame_id: MavFrame::DEFAULT,
21523 child_frame_id: MavFrame::DEFAULT,
21524 reset_counter: 0_u8,
21525 estimator_type: MavEstimatorType::DEFAULT,
21526 quality: 0_i8,
21527 };
21528 #[cfg(feature = "arbitrary")]
21529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21530 use arbitrary::{Arbitrary, Unstructured};
21531 let mut buf = [0u8; 1024];
21532 rng.fill_bytes(&mut buf);
21533 let mut unstructured = Unstructured::new(&buf);
21534 Self::arbitrary(&mut unstructured).unwrap_or_default()
21535 }
21536}
21537impl Default for ODOMETRY_DATA {
21538 fn default() -> Self {
21539 Self::DEFAULT.clone()
21540 }
21541}
21542impl MessageData for ODOMETRY_DATA {
21543 type Message = MavMessage;
21544 const ID: u32 = 331u32;
21545 const NAME: &'static str = "ODOMETRY";
21546 const EXTRA_CRC: u8 = 91u8;
21547 const ENCODED_LEN: usize = 233usize;
21548 fn deser(
21549 _version: MavlinkVersion,
21550 __input: &[u8],
21551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21552 let avail_len = __input.len();
21553 let mut payload_buf = [0; Self::ENCODED_LEN];
21554 let mut buf = if avail_len < Self::ENCODED_LEN {
21555 payload_buf[0..avail_len].copy_from_slice(__input);
21556 Bytes::new(&payload_buf)
21557 } else {
21558 Bytes::new(__input)
21559 };
21560 let mut __struct = Self::default();
21561 __struct.time_usec = buf.get_u64_le();
21562 __struct.x = buf.get_f32_le();
21563 __struct.y = buf.get_f32_le();
21564 __struct.z = buf.get_f32_le();
21565 for v in &mut __struct.q {
21566 let val = buf.get_f32_le();
21567 *v = val;
21568 }
21569 __struct.vx = buf.get_f32_le();
21570 __struct.vy = buf.get_f32_le();
21571 __struct.vz = buf.get_f32_le();
21572 __struct.rollspeed = buf.get_f32_le();
21573 __struct.pitchspeed = buf.get_f32_le();
21574 __struct.yawspeed = buf.get_f32_le();
21575 for v in &mut __struct.pose_covariance {
21576 let val = buf.get_f32_le();
21577 *v = val;
21578 }
21579 for v in &mut __struct.velocity_covariance {
21580 let val = buf.get_f32_le();
21581 *v = val;
21582 }
21583 let tmp = buf.get_u8();
21584 __struct.frame_id =
21585 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21586 enum_type: "MavFrame",
21587 value: tmp as u32,
21588 })?;
21589 let tmp = buf.get_u8();
21590 __struct.child_frame_id =
21591 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21592 enum_type: "MavFrame",
21593 value: tmp as u32,
21594 })?;
21595 __struct.reset_counter = buf.get_u8();
21596 let tmp = buf.get_u8();
21597 __struct.estimator_type =
21598 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21599 enum_type: "MavEstimatorType",
21600 value: tmp as u32,
21601 })?;
21602 __struct.quality = buf.get_i8();
21603 Ok(__struct)
21604 }
21605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21606 let mut __tmp = BytesMut::new(bytes);
21607 #[allow(clippy::absurd_extreme_comparisons)]
21608 #[allow(unused_comparisons)]
21609 if __tmp.remaining() < Self::ENCODED_LEN {
21610 panic!(
21611 "buffer is too small (need {} bytes, but got {})",
21612 Self::ENCODED_LEN,
21613 __tmp.remaining(),
21614 )
21615 }
21616 __tmp.put_u64_le(self.time_usec);
21617 __tmp.put_f32_le(self.x);
21618 __tmp.put_f32_le(self.y);
21619 __tmp.put_f32_le(self.z);
21620 for val in &self.q {
21621 __tmp.put_f32_le(*val);
21622 }
21623 __tmp.put_f32_le(self.vx);
21624 __tmp.put_f32_le(self.vy);
21625 __tmp.put_f32_le(self.vz);
21626 __tmp.put_f32_le(self.rollspeed);
21627 __tmp.put_f32_le(self.pitchspeed);
21628 __tmp.put_f32_le(self.yawspeed);
21629 for val in &self.pose_covariance {
21630 __tmp.put_f32_le(*val);
21631 }
21632 for val in &self.velocity_covariance {
21633 __tmp.put_f32_le(*val);
21634 }
21635 __tmp.put_u8(self.frame_id as u8);
21636 __tmp.put_u8(self.child_frame_id as u8);
21637 if matches!(version, MavlinkVersion::V2) {
21638 __tmp.put_u8(self.reset_counter);
21639 __tmp.put_u8(self.estimator_type as u8);
21640 __tmp.put_i8(self.quality);
21641 let len = __tmp.len();
21642 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21643 } else {
21644 __tmp.len()
21645 }
21646 }
21647}
21648#[doc = "Hardware status sent by an onboard computer."]
21649#[doc = ""]
21650#[doc = "ID: 390"]
21651#[derive(Debug, Clone, PartialEq)]
21652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21654#[cfg_attr(feature = "ts", derive(TS))]
21655#[cfg_attr(feature = "ts", ts(export))]
21656pub struct ONBOARD_COMPUTER_STATUS_DATA {
21657 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21658 pub time_usec: u64,
21659 #[doc = "Time since system boot."]
21660 pub uptime: u32,
21661 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21662 pub ram_usage: u32,
21663 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21664 pub ram_total: u32,
21665 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21666 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21667 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21668 pub storage_type: [u32; 4],
21669 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21670 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21671 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21672 pub storage_usage: [u32; 4],
21673 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21674 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21675 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21676 pub storage_total: [u32; 4],
21677 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21678 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21679 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21680 pub link_type: [u32; 6],
21681 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21683 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21684 pub link_tx_rate: [u32; 6],
21685 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21686 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21687 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21688 pub link_rx_rate: [u32; 6],
21689 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21690 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21691 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21692 pub link_tx_max: [u32; 6],
21693 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21694 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21695 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21696 pub link_rx_max: [u32; 6],
21697 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21698 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21699 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21700 pub fan_speed: [i16; 4],
21701 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21702 pub mavtype: u8,
21703 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21704 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21705 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21706 pub cpu_cores: [u8; 8],
21707 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21708 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21709 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21710 pub cpu_combined: [u8; 10],
21711 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21712 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21713 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21714 pub gpu_cores: [u8; 4],
21715 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21716 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21717 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21718 pub gpu_combined: [u8; 10],
21719 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21720 pub temperature_board: i8,
21721 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21722 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21723 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21724 pub temperature_core: [i8; 8],
21725}
21726impl ONBOARD_COMPUTER_STATUS_DATA {
21727 pub const ENCODED_LEN: usize = 238usize;
21728 pub const DEFAULT: Self = Self {
21729 time_usec: 0_u64,
21730 uptime: 0_u32,
21731 ram_usage: 0_u32,
21732 ram_total: 0_u32,
21733 storage_type: [0_u32; 4usize],
21734 storage_usage: [0_u32; 4usize],
21735 storage_total: [0_u32; 4usize],
21736 link_type: [0_u32; 6usize],
21737 link_tx_rate: [0_u32; 6usize],
21738 link_rx_rate: [0_u32; 6usize],
21739 link_tx_max: [0_u32; 6usize],
21740 link_rx_max: [0_u32; 6usize],
21741 fan_speed: [0_i16; 4usize],
21742 mavtype: 0_u8,
21743 cpu_cores: [0_u8; 8usize],
21744 cpu_combined: [0_u8; 10usize],
21745 gpu_cores: [0_u8; 4usize],
21746 gpu_combined: [0_u8; 10usize],
21747 temperature_board: 0_i8,
21748 temperature_core: [0_i8; 8usize],
21749 };
21750 #[cfg(feature = "arbitrary")]
21751 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21752 use arbitrary::{Arbitrary, Unstructured};
21753 let mut buf = [0u8; 1024];
21754 rng.fill_bytes(&mut buf);
21755 let mut unstructured = Unstructured::new(&buf);
21756 Self::arbitrary(&mut unstructured).unwrap_or_default()
21757 }
21758}
21759impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21760 fn default() -> Self {
21761 Self::DEFAULT.clone()
21762 }
21763}
21764impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21765 type Message = MavMessage;
21766 const ID: u32 = 390u32;
21767 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21768 const EXTRA_CRC: u8 = 156u8;
21769 const ENCODED_LEN: usize = 238usize;
21770 fn deser(
21771 _version: MavlinkVersion,
21772 __input: &[u8],
21773 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21774 let avail_len = __input.len();
21775 let mut payload_buf = [0; Self::ENCODED_LEN];
21776 let mut buf = if avail_len < Self::ENCODED_LEN {
21777 payload_buf[0..avail_len].copy_from_slice(__input);
21778 Bytes::new(&payload_buf)
21779 } else {
21780 Bytes::new(__input)
21781 };
21782 let mut __struct = Self::default();
21783 __struct.time_usec = buf.get_u64_le();
21784 __struct.uptime = buf.get_u32_le();
21785 __struct.ram_usage = buf.get_u32_le();
21786 __struct.ram_total = buf.get_u32_le();
21787 for v in &mut __struct.storage_type {
21788 let val = buf.get_u32_le();
21789 *v = val;
21790 }
21791 for v in &mut __struct.storage_usage {
21792 let val = buf.get_u32_le();
21793 *v = val;
21794 }
21795 for v in &mut __struct.storage_total {
21796 let val = buf.get_u32_le();
21797 *v = val;
21798 }
21799 for v in &mut __struct.link_type {
21800 let val = buf.get_u32_le();
21801 *v = val;
21802 }
21803 for v in &mut __struct.link_tx_rate {
21804 let val = buf.get_u32_le();
21805 *v = val;
21806 }
21807 for v in &mut __struct.link_rx_rate {
21808 let val = buf.get_u32_le();
21809 *v = val;
21810 }
21811 for v in &mut __struct.link_tx_max {
21812 let val = buf.get_u32_le();
21813 *v = val;
21814 }
21815 for v in &mut __struct.link_rx_max {
21816 let val = buf.get_u32_le();
21817 *v = val;
21818 }
21819 for v in &mut __struct.fan_speed {
21820 let val = buf.get_i16_le();
21821 *v = val;
21822 }
21823 __struct.mavtype = buf.get_u8();
21824 for v in &mut __struct.cpu_cores {
21825 let val = buf.get_u8();
21826 *v = val;
21827 }
21828 for v in &mut __struct.cpu_combined {
21829 let val = buf.get_u8();
21830 *v = val;
21831 }
21832 for v in &mut __struct.gpu_cores {
21833 let val = buf.get_u8();
21834 *v = val;
21835 }
21836 for v in &mut __struct.gpu_combined {
21837 let val = buf.get_u8();
21838 *v = val;
21839 }
21840 __struct.temperature_board = buf.get_i8();
21841 for v in &mut __struct.temperature_core {
21842 let val = buf.get_i8();
21843 *v = val;
21844 }
21845 Ok(__struct)
21846 }
21847 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21848 let mut __tmp = BytesMut::new(bytes);
21849 #[allow(clippy::absurd_extreme_comparisons)]
21850 #[allow(unused_comparisons)]
21851 if __tmp.remaining() < Self::ENCODED_LEN {
21852 panic!(
21853 "buffer is too small (need {} bytes, but got {})",
21854 Self::ENCODED_LEN,
21855 __tmp.remaining(),
21856 )
21857 }
21858 __tmp.put_u64_le(self.time_usec);
21859 __tmp.put_u32_le(self.uptime);
21860 __tmp.put_u32_le(self.ram_usage);
21861 __tmp.put_u32_le(self.ram_total);
21862 for val in &self.storage_type {
21863 __tmp.put_u32_le(*val);
21864 }
21865 for val in &self.storage_usage {
21866 __tmp.put_u32_le(*val);
21867 }
21868 for val in &self.storage_total {
21869 __tmp.put_u32_le(*val);
21870 }
21871 for val in &self.link_type {
21872 __tmp.put_u32_le(*val);
21873 }
21874 for val in &self.link_tx_rate {
21875 __tmp.put_u32_le(*val);
21876 }
21877 for val in &self.link_rx_rate {
21878 __tmp.put_u32_le(*val);
21879 }
21880 for val in &self.link_tx_max {
21881 __tmp.put_u32_le(*val);
21882 }
21883 for val in &self.link_rx_max {
21884 __tmp.put_u32_le(*val);
21885 }
21886 for val in &self.fan_speed {
21887 __tmp.put_i16_le(*val);
21888 }
21889 __tmp.put_u8(self.mavtype);
21890 for val in &self.cpu_cores {
21891 __tmp.put_u8(*val);
21892 }
21893 for val in &self.cpu_combined {
21894 __tmp.put_u8(*val);
21895 }
21896 for val in &self.gpu_cores {
21897 __tmp.put_u8(*val);
21898 }
21899 for val in &self.gpu_combined {
21900 __tmp.put_u8(*val);
21901 }
21902 __tmp.put_i8(self.temperature_board);
21903 for val in &self.temperature_core {
21904 __tmp.put_i8(*val);
21905 }
21906 if matches!(version, MavlinkVersion::V2) {
21907 let len = __tmp.len();
21908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21909 } else {
21910 __tmp.len()
21911 }
21912 }
21913}
21914#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21915#[doc = ""]
21916#[doc = "ID: 12918"]
21917#[derive(Debug, Clone, PartialEq)]
21918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21920#[cfg_attr(feature = "ts", derive(TS))]
21921#[cfg_attr(feature = "ts", ts(export))]
21922pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21923 #[doc = "Status level indicating if arming is allowed."]
21924 pub status: MavOdidArmStatus,
21925 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21926 #[cfg_attr(feature = "ts", ts(type = "string"))]
21927 pub error: CharArray<50>,
21928}
21929impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21930 pub const ENCODED_LEN: usize = 51usize;
21931 pub const DEFAULT: Self = Self {
21932 status: MavOdidArmStatus::DEFAULT,
21933 error: CharArray::new([0_u8; 50usize]),
21934 };
21935 #[cfg(feature = "arbitrary")]
21936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21937 use arbitrary::{Arbitrary, Unstructured};
21938 let mut buf = [0u8; 1024];
21939 rng.fill_bytes(&mut buf);
21940 let mut unstructured = Unstructured::new(&buf);
21941 Self::arbitrary(&mut unstructured).unwrap_or_default()
21942 }
21943}
21944impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21945 fn default() -> Self {
21946 Self::DEFAULT.clone()
21947 }
21948}
21949impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21950 type Message = MavMessage;
21951 const ID: u32 = 12918u32;
21952 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21953 const EXTRA_CRC: u8 = 139u8;
21954 const ENCODED_LEN: usize = 51usize;
21955 fn deser(
21956 _version: MavlinkVersion,
21957 __input: &[u8],
21958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21959 let avail_len = __input.len();
21960 let mut payload_buf = [0; Self::ENCODED_LEN];
21961 let mut buf = if avail_len < Self::ENCODED_LEN {
21962 payload_buf[0..avail_len].copy_from_slice(__input);
21963 Bytes::new(&payload_buf)
21964 } else {
21965 Bytes::new(__input)
21966 };
21967 let mut __struct = Self::default();
21968 let tmp = buf.get_u8();
21969 __struct.status =
21970 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21971 enum_type: "MavOdidArmStatus",
21972 value: tmp as u32,
21973 })?;
21974 let mut tmp = [0_u8; 50usize];
21975 for v in &mut tmp {
21976 *v = buf.get_u8();
21977 }
21978 __struct.error = CharArray::new(tmp);
21979 Ok(__struct)
21980 }
21981 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21982 let mut __tmp = BytesMut::new(bytes);
21983 #[allow(clippy::absurd_extreme_comparisons)]
21984 #[allow(unused_comparisons)]
21985 if __tmp.remaining() < Self::ENCODED_LEN {
21986 panic!(
21987 "buffer is too small (need {} bytes, but got {})",
21988 Self::ENCODED_LEN,
21989 __tmp.remaining(),
21990 )
21991 }
21992 __tmp.put_u8(self.status as u8);
21993 for val in &self.error {
21994 __tmp.put_u8(*val);
21995 }
21996 if matches!(version, MavlinkVersion::V2) {
21997 let len = __tmp.len();
21998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21999 } else {
22000 __tmp.len()
22001 }
22002 }
22003}
22004#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22005#[doc = ""]
22006#[doc = "ID: 12902"]
22007#[derive(Debug, Clone, PartialEq)]
22008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22010#[cfg_attr(feature = "ts", derive(TS))]
22011#[cfg_attr(feature = "ts", ts(export))]
22012pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22013 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22014 pub timestamp: u32,
22015 #[doc = "System ID (0 for broadcast)."]
22016 pub target_system: u8,
22017 #[doc = "Component ID (0 for broadcast)."]
22018 pub target_component: u8,
22019 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22020 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22021 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22022 pub id_or_mac: [u8; 20],
22023 #[doc = "Indicates the type of authentication."]
22024 pub authentication_type: MavOdidAuthType,
22025 #[doc = "Allowed range is 0 - 15."]
22026 pub data_page: u8,
22027 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22028 pub last_page_index: u8,
22029 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22030 pub length: u8,
22031 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22032 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22033 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22034 pub authentication_data: [u8; 23],
22035}
22036impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22037 pub const ENCODED_LEN: usize = 53usize;
22038 pub const DEFAULT: Self = Self {
22039 timestamp: 0_u32,
22040 target_system: 0_u8,
22041 target_component: 0_u8,
22042 id_or_mac: [0_u8; 20usize],
22043 authentication_type: MavOdidAuthType::DEFAULT,
22044 data_page: 0_u8,
22045 last_page_index: 0_u8,
22046 length: 0_u8,
22047 authentication_data: [0_u8; 23usize],
22048 };
22049 #[cfg(feature = "arbitrary")]
22050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22051 use arbitrary::{Arbitrary, Unstructured};
22052 let mut buf = [0u8; 1024];
22053 rng.fill_bytes(&mut buf);
22054 let mut unstructured = Unstructured::new(&buf);
22055 Self::arbitrary(&mut unstructured).unwrap_or_default()
22056 }
22057}
22058impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22059 fn default() -> Self {
22060 Self::DEFAULT.clone()
22061 }
22062}
22063impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22064 type Message = MavMessage;
22065 const ID: u32 = 12902u32;
22066 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22067 const EXTRA_CRC: u8 = 140u8;
22068 const ENCODED_LEN: usize = 53usize;
22069 fn deser(
22070 _version: MavlinkVersion,
22071 __input: &[u8],
22072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22073 let avail_len = __input.len();
22074 let mut payload_buf = [0; Self::ENCODED_LEN];
22075 let mut buf = if avail_len < Self::ENCODED_LEN {
22076 payload_buf[0..avail_len].copy_from_slice(__input);
22077 Bytes::new(&payload_buf)
22078 } else {
22079 Bytes::new(__input)
22080 };
22081 let mut __struct = Self::default();
22082 __struct.timestamp = buf.get_u32_le();
22083 __struct.target_system = buf.get_u8();
22084 __struct.target_component = buf.get_u8();
22085 for v in &mut __struct.id_or_mac {
22086 let val = buf.get_u8();
22087 *v = val;
22088 }
22089 let tmp = buf.get_u8();
22090 __struct.authentication_type =
22091 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22092 enum_type: "MavOdidAuthType",
22093 value: tmp as u32,
22094 })?;
22095 __struct.data_page = buf.get_u8();
22096 __struct.last_page_index = buf.get_u8();
22097 __struct.length = buf.get_u8();
22098 for v in &mut __struct.authentication_data {
22099 let val = buf.get_u8();
22100 *v = val;
22101 }
22102 Ok(__struct)
22103 }
22104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22105 let mut __tmp = BytesMut::new(bytes);
22106 #[allow(clippy::absurd_extreme_comparisons)]
22107 #[allow(unused_comparisons)]
22108 if __tmp.remaining() < Self::ENCODED_LEN {
22109 panic!(
22110 "buffer is too small (need {} bytes, but got {})",
22111 Self::ENCODED_LEN,
22112 __tmp.remaining(),
22113 )
22114 }
22115 __tmp.put_u32_le(self.timestamp);
22116 __tmp.put_u8(self.target_system);
22117 __tmp.put_u8(self.target_component);
22118 for val in &self.id_or_mac {
22119 __tmp.put_u8(*val);
22120 }
22121 __tmp.put_u8(self.authentication_type as u8);
22122 __tmp.put_u8(self.data_page);
22123 __tmp.put_u8(self.last_page_index);
22124 __tmp.put_u8(self.length);
22125 for val in &self.authentication_data {
22126 __tmp.put_u8(*val);
22127 }
22128 if matches!(version, MavlinkVersion::V2) {
22129 let len = __tmp.len();
22130 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22131 } else {
22132 __tmp.len()
22133 }
22134 }
22135}
22136#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22137#[doc = ""]
22138#[doc = "ID: 12900"]
22139#[derive(Debug, Clone, PartialEq)]
22140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22141#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22142#[cfg_attr(feature = "ts", derive(TS))]
22143#[cfg_attr(feature = "ts", ts(export))]
22144pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22145 #[doc = "System ID (0 for broadcast)."]
22146 pub target_system: u8,
22147 #[doc = "Component ID (0 for broadcast)."]
22148 pub target_component: u8,
22149 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22150 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22151 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22152 pub id_or_mac: [u8; 20],
22153 #[doc = "Indicates the format for the uas_id field of this message."]
22154 pub id_type: MavOdidIdType,
22155 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22156 pub ua_type: MavOdidUaType,
22157 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22158 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22159 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22160 pub uas_id: [u8; 20],
22161}
22162impl OPEN_DRONE_ID_BASIC_ID_DATA {
22163 pub const ENCODED_LEN: usize = 44usize;
22164 pub const DEFAULT: Self = Self {
22165 target_system: 0_u8,
22166 target_component: 0_u8,
22167 id_or_mac: [0_u8; 20usize],
22168 id_type: MavOdidIdType::DEFAULT,
22169 ua_type: MavOdidUaType::DEFAULT,
22170 uas_id: [0_u8; 20usize],
22171 };
22172 #[cfg(feature = "arbitrary")]
22173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22174 use arbitrary::{Arbitrary, Unstructured};
22175 let mut buf = [0u8; 1024];
22176 rng.fill_bytes(&mut buf);
22177 let mut unstructured = Unstructured::new(&buf);
22178 Self::arbitrary(&mut unstructured).unwrap_or_default()
22179 }
22180}
22181impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22182 fn default() -> Self {
22183 Self::DEFAULT.clone()
22184 }
22185}
22186impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22187 type Message = MavMessage;
22188 const ID: u32 = 12900u32;
22189 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22190 const EXTRA_CRC: u8 = 114u8;
22191 const ENCODED_LEN: usize = 44usize;
22192 fn deser(
22193 _version: MavlinkVersion,
22194 __input: &[u8],
22195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22196 let avail_len = __input.len();
22197 let mut payload_buf = [0; Self::ENCODED_LEN];
22198 let mut buf = if avail_len < Self::ENCODED_LEN {
22199 payload_buf[0..avail_len].copy_from_slice(__input);
22200 Bytes::new(&payload_buf)
22201 } else {
22202 Bytes::new(__input)
22203 };
22204 let mut __struct = Self::default();
22205 __struct.target_system = buf.get_u8();
22206 __struct.target_component = buf.get_u8();
22207 for v in &mut __struct.id_or_mac {
22208 let val = buf.get_u8();
22209 *v = val;
22210 }
22211 let tmp = buf.get_u8();
22212 __struct.id_type =
22213 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22214 enum_type: "MavOdidIdType",
22215 value: tmp as u32,
22216 })?;
22217 let tmp = buf.get_u8();
22218 __struct.ua_type =
22219 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22220 enum_type: "MavOdidUaType",
22221 value: tmp as u32,
22222 })?;
22223 for v in &mut __struct.uas_id {
22224 let val = buf.get_u8();
22225 *v = val;
22226 }
22227 Ok(__struct)
22228 }
22229 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22230 let mut __tmp = BytesMut::new(bytes);
22231 #[allow(clippy::absurd_extreme_comparisons)]
22232 #[allow(unused_comparisons)]
22233 if __tmp.remaining() < Self::ENCODED_LEN {
22234 panic!(
22235 "buffer is too small (need {} bytes, but got {})",
22236 Self::ENCODED_LEN,
22237 __tmp.remaining(),
22238 )
22239 }
22240 __tmp.put_u8(self.target_system);
22241 __tmp.put_u8(self.target_component);
22242 for val in &self.id_or_mac {
22243 __tmp.put_u8(*val);
22244 }
22245 __tmp.put_u8(self.id_type as u8);
22246 __tmp.put_u8(self.ua_type as u8);
22247 for val in &self.uas_id {
22248 __tmp.put_u8(*val);
22249 }
22250 if matches!(version, MavlinkVersion::V2) {
22251 let len = __tmp.len();
22252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22253 } else {
22254 __tmp.len()
22255 }
22256 }
22257}
22258#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22259#[doc = ""]
22260#[doc = "ID: 12901"]
22261#[derive(Debug, Clone, PartialEq)]
22262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22263#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22264#[cfg_attr(feature = "ts", derive(TS))]
22265#[cfg_attr(feature = "ts", ts(export))]
22266pub struct OPEN_DRONE_ID_LOCATION_DATA {
22267 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22268 pub latitude: i32,
22269 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22270 pub longitude: i32,
22271 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22272 pub altitude_barometric: f32,
22273 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22274 pub altitude_geodetic: f32,
22275 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22276 pub height: f32,
22277 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22278 pub timestamp: f32,
22279 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22280 pub direction: u16,
22281 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22282 pub speed_horizontal: u16,
22283 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22284 pub speed_vertical: i16,
22285 #[doc = "System ID (0 for broadcast)."]
22286 pub target_system: u8,
22287 #[doc = "Component ID (0 for broadcast)."]
22288 pub target_component: u8,
22289 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22290 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22291 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22292 pub id_or_mac: [u8; 20],
22293 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22294 pub status: MavOdidStatus,
22295 #[doc = "Indicates the reference point for the height field."]
22296 pub height_reference: MavOdidHeightRef,
22297 #[doc = "The accuracy of the horizontal position."]
22298 pub horizontal_accuracy: MavOdidHorAcc,
22299 #[doc = "The accuracy of the vertical position."]
22300 pub vertical_accuracy: MavOdidVerAcc,
22301 #[doc = "The accuracy of the barometric altitude."]
22302 pub barometer_accuracy: MavOdidVerAcc,
22303 #[doc = "The accuracy of the horizontal and vertical speed."]
22304 pub speed_accuracy: MavOdidSpeedAcc,
22305 #[doc = "The accuracy of the timestamps."]
22306 pub timestamp_accuracy: MavOdidTimeAcc,
22307}
22308impl OPEN_DRONE_ID_LOCATION_DATA {
22309 pub const ENCODED_LEN: usize = 59usize;
22310 pub const DEFAULT: Self = Self {
22311 latitude: 0_i32,
22312 longitude: 0_i32,
22313 altitude_barometric: 0.0_f32,
22314 altitude_geodetic: 0.0_f32,
22315 height: 0.0_f32,
22316 timestamp: 0.0_f32,
22317 direction: 0_u16,
22318 speed_horizontal: 0_u16,
22319 speed_vertical: 0_i16,
22320 target_system: 0_u8,
22321 target_component: 0_u8,
22322 id_or_mac: [0_u8; 20usize],
22323 status: MavOdidStatus::DEFAULT,
22324 height_reference: MavOdidHeightRef::DEFAULT,
22325 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22326 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22327 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22328 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22329 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22330 };
22331 #[cfg(feature = "arbitrary")]
22332 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22333 use arbitrary::{Arbitrary, Unstructured};
22334 let mut buf = [0u8; 1024];
22335 rng.fill_bytes(&mut buf);
22336 let mut unstructured = Unstructured::new(&buf);
22337 Self::arbitrary(&mut unstructured).unwrap_or_default()
22338 }
22339}
22340impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22341 fn default() -> Self {
22342 Self::DEFAULT.clone()
22343 }
22344}
22345impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22346 type Message = MavMessage;
22347 const ID: u32 = 12901u32;
22348 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22349 const EXTRA_CRC: u8 = 254u8;
22350 const ENCODED_LEN: usize = 59usize;
22351 fn deser(
22352 _version: MavlinkVersion,
22353 __input: &[u8],
22354 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22355 let avail_len = __input.len();
22356 let mut payload_buf = [0; Self::ENCODED_LEN];
22357 let mut buf = if avail_len < Self::ENCODED_LEN {
22358 payload_buf[0..avail_len].copy_from_slice(__input);
22359 Bytes::new(&payload_buf)
22360 } else {
22361 Bytes::new(__input)
22362 };
22363 let mut __struct = Self::default();
22364 __struct.latitude = buf.get_i32_le();
22365 __struct.longitude = buf.get_i32_le();
22366 __struct.altitude_barometric = buf.get_f32_le();
22367 __struct.altitude_geodetic = buf.get_f32_le();
22368 __struct.height = buf.get_f32_le();
22369 __struct.timestamp = buf.get_f32_le();
22370 __struct.direction = buf.get_u16_le();
22371 __struct.speed_horizontal = buf.get_u16_le();
22372 __struct.speed_vertical = buf.get_i16_le();
22373 __struct.target_system = buf.get_u8();
22374 __struct.target_component = buf.get_u8();
22375 for v in &mut __struct.id_or_mac {
22376 let val = buf.get_u8();
22377 *v = val;
22378 }
22379 let tmp = buf.get_u8();
22380 __struct.status =
22381 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22382 enum_type: "MavOdidStatus",
22383 value: tmp as u32,
22384 })?;
22385 let tmp = buf.get_u8();
22386 __struct.height_reference =
22387 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22388 enum_type: "MavOdidHeightRef",
22389 value: tmp as u32,
22390 })?;
22391 let tmp = buf.get_u8();
22392 __struct.horizontal_accuracy =
22393 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22394 enum_type: "MavOdidHorAcc",
22395 value: tmp as u32,
22396 })?;
22397 let tmp = buf.get_u8();
22398 __struct.vertical_accuracy =
22399 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22400 enum_type: "MavOdidVerAcc",
22401 value: tmp as u32,
22402 })?;
22403 let tmp = buf.get_u8();
22404 __struct.barometer_accuracy =
22405 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22406 enum_type: "MavOdidVerAcc",
22407 value: tmp as u32,
22408 })?;
22409 let tmp = buf.get_u8();
22410 __struct.speed_accuracy =
22411 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22412 enum_type: "MavOdidSpeedAcc",
22413 value: tmp as u32,
22414 })?;
22415 let tmp = buf.get_u8();
22416 __struct.timestamp_accuracy =
22417 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22418 enum_type: "MavOdidTimeAcc",
22419 value: tmp as u32,
22420 })?;
22421 Ok(__struct)
22422 }
22423 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22424 let mut __tmp = BytesMut::new(bytes);
22425 #[allow(clippy::absurd_extreme_comparisons)]
22426 #[allow(unused_comparisons)]
22427 if __tmp.remaining() < Self::ENCODED_LEN {
22428 panic!(
22429 "buffer is too small (need {} bytes, but got {})",
22430 Self::ENCODED_LEN,
22431 __tmp.remaining(),
22432 )
22433 }
22434 __tmp.put_i32_le(self.latitude);
22435 __tmp.put_i32_le(self.longitude);
22436 __tmp.put_f32_le(self.altitude_barometric);
22437 __tmp.put_f32_le(self.altitude_geodetic);
22438 __tmp.put_f32_le(self.height);
22439 __tmp.put_f32_le(self.timestamp);
22440 __tmp.put_u16_le(self.direction);
22441 __tmp.put_u16_le(self.speed_horizontal);
22442 __tmp.put_i16_le(self.speed_vertical);
22443 __tmp.put_u8(self.target_system);
22444 __tmp.put_u8(self.target_component);
22445 for val in &self.id_or_mac {
22446 __tmp.put_u8(*val);
22447 }
22448 __tmp.put_u8(self.status as u8);
22449 __tmp.put_u8(self.height_reference as u8);
22450 __tmp.put_u8(self.horizontal_accuracy as u8);
22451 __tmp.put_u8(self.vertical_accuracy as u8);
22452 __tmp.put_u8(self.barometer_accuracy as u8);
22453 __tmp.put_u8(self.speed_accuracy as u8);
22454 __tmp.put_u8(self.timestamp_accuracy as u8);
22455 if matches!(version, MavlinkVersion::V2) {
22456 let len = __tmp.len();
22457 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22458 } else {
22459 __tmp.len()
22460 }
22461 }
22462}
22463#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22464#[doc = ""]
22465#[doc = "ID: 12915"]
22466#[derive(Debug, Clone, PartialEq)]
22467#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22468#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22469#[cfg_attr(feature = "ts", derive(TS))]
22470#[cfg_attr(feature = "ts", ts(export))]
22471pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22472 #[doc = "System ID (0 for broadcast)."]
22473 pub target_system: u8,
22474 #[doc = "Component ID (0 for broadcast)."]
22475 pub target_component: u8,
22476 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22478 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22479 pub id_or_mac: [u8; 20],
22480 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22481 pub single_message_size: u8,
22482 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22483 pub msg_pack_size: u8,
22484 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22486 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22487 pub messages: [u8; 225],
22488}
22489impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22490 pub const ENCODED_LEN: usize = 249usize;
22491 pub const DEFAULT: Self = Self {
22492 target_system: 0_u8,
22493 target_component: 0_u8,
22494 id_or_mac: [0_u8; 20usize],
22495 single_message_size: 0_u8,
22496 msg_pack_size: 0_u8,
22497 messages: [0_u8; 225usize],
22498 };
22499 #[cfg(feature = "arbitrary")]
22500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22501 use arbitrary::{Arbitrary, Unstructured};
22502 let mut buf = [0u8; 1024];
22503 rng.fill_bytes(&mut buf);
22504 let mut unstructured = Unstructured::new(&buf);
22505 Self::arbitrary(&mut unstructured).unwrap_or_default()
22506 }
22507}
22508impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22509 fn default() -> Self {
22510 Self::DEFAULT.clone()
22511 }
22512}
22513impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22514 type Message = MavMessage;
22515 const ID: u32 = 12915u32;
22516 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22517 const EXTRA_CRC: u8 = 94u8;
22518 const ENCODED_LEN: usize = 249usize;
22519 fn deser(
22520 _version: MavlinkVersion,
22521 __input: &[u8],
22522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22523 let avail_len = __input.len();
22524 let mut payload_buf = [0; Self::ENCODED_LEN];
22525 let mut buf = if avail_len < Self::ENCODED_LEN {
22526 payload_buf[0..avail_len].copy_from_slice(__input);
22527 Bytes::new(&payload_buf)
22528 } else {
22529 Bytes::new(__input)
22530 };
22531 let mut __struct = Self::default();
22532 __struct.target_system = buf.get_u8();
22533 __struct.target_component = buf.get_u8();
22534 for v in &mut __struct.id_or_mac {
22535 let val = buf.get_u8();
22536 *v = val;
22537 }
22538 __struct.single_message_size = buf.get_u8();
22539 __struct.msg_pack_size = buf.get_u8();
22540 for v in &mut __struct.messages {
22541 let val = buf.get_u8();
22542 *v = val;
22543 }
22544 Ok(__struct)
22545 }
22546 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22547 let mut __tmp = BytesMut::new(bytes);
22548 #[allow(clippy::absurd_extreme_comparisons)]
22549 #[allow(unused_comparisons)]
22550 if __tmp.remaining() < Self::ENCODED_LEN {
22551 panic!(
22552 "buffer is too small (need {} bytes, but got {})",
22553 Self::ENCODED_LEN,
22554 __tmp.remaining(),
22555 )
22556 }
22557 __tmp.put_u8(self.target_system);
22558 __tmp.put_u8(self.target_component);
22559 for val in &self.id_or_mac {
22560 __tmp.put_u8(*val);
22561 }
22562 __tmp.put_u8(self.single_message_size);
22563 __tmp.put_u8(self.msg_pack_size);
22564 for val in &self.messages {
22565 __tmp.put_u8(*val);
22566 }
22567 if matches!(version, MavlinkVersion::V2) {
22568 let len = __tmp.len();
22569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22570 } else {
22571 __tmp.len()
22572 }
22573 }
22574}
22575#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22576#[doc = ""]
22577#[doc = "ID: 12905"]
22578#[derive(Debug, Clone, PartialEq)]
22579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22581#[cfg_attr(feature = "ts", derive(TS))]
22582#[cfg_attr(feature = "ts", ts(export))]
22583pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22584 #[doc = "System ID (0 for broadcast)."]
22585 pub target_system: u8,
22586 #[doc = "Component ID (0 for broadcast)."]
22587 pub target_component: u8,
22588 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22589 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22590 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22591 pub id_or_mac: [u8; 20],
22592 #[doc = "Indicates the type of the operator_id field."]
22593 pub operator_id_type: MavOdidOperatorIdType,
22594 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22595 #[cfg_attr(feature = "ts", ts(type = "string"))]
22596 pub operator_id: CharArray<20>,
22597}
22598impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22599 pub const ENCODED_LEN: usize = 43usize;
22600 pub const DEFAULT: Self = Self {
22601 target_system: 0_u8,
22602 target_component: 0_u8,
22603 id_or_mac: [0_u8; 20usize],
22604 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22605 operator_id: CharArray::new([0_u8; 20usize]),
22606 };
22607 #[cfg(feature = "arbitrary")]
22608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22609 use arbitrary::{Arbitrary, Unstructured};
22610 let mut buf = [0u8; 1024];
22611 rng.fill_bytes(&mut buf);
22612 let mut unstructured = Unstructured::new(&buf);
22613 Self::arbitrary(&mut unstructured).unwrap_or_default()
22614 }
22615}
22616impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22617 fn default() -> Self {
22618 Self::DEFAULT.clone()
22619 }
22620}
22621impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22622 type Message = MavMessage;
22623 const ID: u32 = 12905u32;
22624 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22625 const EXTRA_CRC: u8 = 49u8;
22626 const ENCODED_LEN: usize = 43usize;
22627 fn deser(
22628 _version: MavlinkVersion,
22629 __input: &[u8],
22630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22631 let avail_len = __input.len();
22632 let mut payload_buf = [0; Self::ENCODED_LEN];
22633 let mut buf = if avail_len < Self::ENCODED_LEN {
22634 payload_buf[0..avail_len].copy_from_slice(__input);
22635 Bytes::new(&payload_buf)
22636 } else {
22637 Bytes::new(__input)
22638 };
22639 let mut __struct = Self::default();
22640 __struct.target_system = buf.get_u8();
22641 __struct.target_component = buf.get_u8();
22642 for v in &mut __struct.id_or_mac {
22643 let val = buf.get_u8();
22644 *v = val;
22645 }
22646 let tmp = buf.get_u8();
22647 __struct.operator_id_type =
22648 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22649 enum_type: "MavOdidOperatorIdType",
22650 value: tmp as u32,
22651 })?;
22652 let mut tmp = [0_u8; 20usize];
22653 for v in &mut tmp {
22654 *v = buf.get_u8();
22655 }
22656 __struct.operator_id = CharArray::new(tmp);
22657 Ok(__struct)
22658 }
22659 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22660 let mut __tmp = BytesMut::new(bytes);
22661 #[allow(clippy::absurd_extreme_comparisons)]
22662 #[allow(unused_comparisons)]
22663 if __tmp.remaining() < Self::ENCODED_LEN {
22664 panic!(
22665 "buffer is too small (need {} bytes, but got {})",
22666 Self::ENCODED_LEN,
22667 __tmp.remaining(),
22668 )
22669 }
22670 __tmp.put_u8(self.target_system);
22671 __tmp.put_u8(self.target_component);
22672 for val in &self.id_or_mac {
22673 __tmp.put_u8(*val);
22674 }
22675 __tmp.put_u8(self.operator_id_type as u8);
22676 for val in &self.operator_id {
22677 __tmp.put_u8(*val);
22678 }
22679 if matches!(version, MavlinkVersion::V2) {
22680 let len = __tmp.len();
22681 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22682 } else {
22683 __tmp.len()
22684 }
22685 }
22686}
22687#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22688#[doc = ""]
22689#[doc = "ID: 12903"]
22690#[derive(Debug, Clone, PartialEq)]
22691#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22692#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22693#[cfg_attr(feature = "ts", derive(TS))]
22694#[cfg_attr(feature = "ts", ts(export))]
22695pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22696 #[doc = "System ID (0 for broadcast)."]
22697 pub target_system: u8,
22698 #[doc = "Component ID (0 for broadcast)."]
22699 pub target_component: u8,
22700 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22701 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22702 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22703 pub id_or_mac: [u8; 20],
22704 #[doc = "Indicates the type of the description field."]
22705 pub description_type: MavOdidDescType,
22706 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22707 #[cfg_attr(feature = "ts", ts(type = "string"))]
22708 pub description: CharArray<23>,
22709}
22710impl OPEN_DRONE_ID_SELF_ID_DATA {
22711 pub const ENCODED_LEN: usize = 46usize;
22712 pub const DEFAULT: Self = Self {
22713 target_system: 0_u8,
22714 target_component: 0_u8,
22715 id_or_mac: [0_u8; 20usize],
22716 description_type: MavOdidDescType::DEFAULT,
22717 description: CharArray::new([0_u8; 23usize]),
22718 };
22719 #[cfg(feature = "arbitrary")]
22720 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22721 use arbitrary::{Arbitrary, Unstructured};
22722 let mut buf = [0u8; 1024];
22723 rng.fill_bytes(&mut buf);
22724 let mut unstructured = Unstructured::new(&buf);
22725 Self::arbitrary(&mut unstructured).unwrap_or_default()
22726 }
22727}
22728impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22729 fn default() -> Self {
22730 Self::DEFAULT.clone()
22731 }
22732}
22733impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22734 type Message = MavMessage;
22735 const ID: u32 = 12903u32;
22736 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22737 const EXTRA_CRC: u8 = 249u8;
22738 const ENCODED_LEN: usize = 46usize;
22739 fn deser(
22740 _version: MavlinkVersion,
22741 __input: &[u8],
22742 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22743 let avail_len = __input.len();
22744 let mut payload_buf = [0; Self::ENCODED_LEN];
22745 let mut buf = if avail_len < Self::ENCODED_LEN {
22746 payload_buf[0..avail_len].copy_from_slice(__input);
22747 Bytes::new(&payload_buf)
22748 } else {
22749 Bytes::new(__input)
22750 };
22751 let mut __struct = Self::default();
22752 __struct.target_system = buf.get_u8();
22753 __struct.target_component = buf.get_u8();
22754 for v in &mut __struct.id_or_mac {
22755 let val = buf.get_u8();
22756 *v = val;
22757 }
22758 let tmp = buf.get_u8();
22759 __struct.description_type =
22760 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22761 enum_type: "MavOdidDescType",
22762 value: tmp as u32,
22763 })?;
22764 let mut tmp = [0_u8; 23usize];
22765 for v in &mut tmp {
22766 *v = buf.get_u8();
22767 }
22768 __struct.description = CharArray::new(tmp);
22769 Ok(__struct)
22770 }
22771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22772 let mut __tmp = BytesMut::new(bytes);
22773 #[allow(clippy::absurd_extreme_comparisons)]
22774 #[allow(unused_comparisons)]
22775 if __tmp.remaining() < Self::ENCODED_LEN {
22776 panic!(
22777 "buffer is too small (need {} bytes, but got {})",
22778 Self::ENCODED_LEN,
22779 __tmp.remaining(),
22780 )
22781 }
22782 __tmp.put_u8(self.target_system);
22783 __tmp.put_u8(self.target_component);
22784 for val in &self.id_or_mac {
22785 __tmp.put_u8(*val);
22786 }
22787 __tmp.put_u8(self.description_type as u8);
22788 for val in &self.description {
22789 __tmp.put_u8(*val);
22790 }
22791 if matches!(version, MavlinkVersion::V2) {
22792 let len = __tmp.len();
22793 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22794 } else {
22795 __tmp.len()
22796 }
22797 }
22798}
22799#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22800#[doc = ""]
22801#[doc = "ID: 12904"]
22802#[derive(Debug, Clone, PartialEq)]
22803#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22804#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22805#[cfg_attr(feature = "ts", derive(TS))]
22806#[cfg_attr(feature = "ts", ts(export))]
22807pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22808 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22809 pub operator_latitude: i32,
22810 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22811 pub operator_longitude: i32,
22812 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22813 pub area_ceiling: f32,
22814 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22815 pub area_floor: f32,
22816 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22817 pub operator_altitude_geo: f32,
22818 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22819 pub timestamp: u32,
22820 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22821 pub area_count: u16,
22822 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22823 pub area_radius: u16,
22824 #[doc = "System ID (0 for broadcast)."]
22825 pub target_system: u8,
22826 #[doc = "Component ID (0 for broadcast)."]
22827 pub target_component: u8,
22828 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22829 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22830 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22831 pub id_or_mac: [u8; 20],
22832 #[doc = "Specifies the operator location type."]
22833 pub operator_location_type: MavOdidOperatorLocationType,
22834 #[doc = "Specifies the classification type of the UA."]
22835 pub classification_type: MavOdidClassificationType,
22836 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22837 pub category_eu: MavOdidCategoryEu,
22838 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22839 pub class_eu: MavOdidClassEu,
22840}
22841impl OPEN_DRONE_ID_SYSTEM_DATA {
22842 pub const ENCODED_LEN: usize = 54usize;
22843 pub const DEFAULT: Self = Self {
22844 operator_latitude: 0_i32,
22845 operator_longitude: 0_i32,
22846 area_ceiling: 0.0_f32,
22847 area_floor: 0.0_f32,
22848 operator_altitude_geo: 0.0_f32,
22849 timestamp: 0_u32,
22850 area_count: 0_u16,
22851 area_radius: 0_u16,
22852 target_system: 0_u8,
22853 target_component: 0_u8,
22854 id_or_mac: [0_u8; 20usize],
22855 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22856 classification_type: MavOdidClassificationType::DEFAULT,
22857 category_eu: MavOdidCategoryEu::DEFAULT,
22858 class_eu: MavOdidClassEu::DEFAULT,
22859 };
22860 #[cfg(feature = "arbitrary")]
22861 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22862 use arbitrary::{Arbitrary, Unstructured};
22863 let mut buf = [0u8; 1024];
22864 rng.fill_bytes(&mut buf);
22865 let mut unstructured = Unstructured::new(&buf);
22866 Self::arbitrary(&mut unstructured).unwrap_or_default()
22867 }
22868}
22869impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22870 fn default() -> Self {
22871 Self::DEFAULT.clone()
22872 }
22873}
22874impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22875 type Message = MavMessage;
22876 const ID: u32 = 12904u32;
22877 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22878 const EXTRA_CRC: u8 = 77u8;
22879 const ENCODED_LEN: usize = 54usize;
22880 fn deser(
22881 _version: MavlinkVersion,
22882 __input: &[u8],
22883 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22884 let avail_len = __input.len();
22885 let mut payload_buf = [0; Self::ENCODED_LEN];
22886 let mut buf = if avail_len < Self::ENCODED_LEN {
22887 payload_buf[0..avail_len].copy_from_slice(__input);
22888 Bytes::new(&payload_buf)
22889 } else {
22890 Bytes::new(__input)
22891 };
22892 let mut __struct = Self::default();
22893 __struct.operator_latitude = buf.get_i32_le();
22894 __struct.operator_longitude = buf.get_i32_le();
22895 __struct.area_ceiling = buf.get_f32_le();
22896 __struct.area_floor = buf.get_f32_le();
22897 __struct.operator_altitude_geo = buf.get_f32_le();
22898 __struct.timestamp = buf.get_u32_le();
22899 __struct.area_count = buf.get_u16_le();
22900 __struct.area_radius = buf.get_u16_le();
22901 __struct.target_system = buf.get_u8();
22902 __struct.target_component = buf.get_u8();
22903 for v in &mut __struct.id_or_mac {
22904 let val = buf.get_u8();
22905 *v = val;
22906 }
22907 let tmp = buf.get_u8();
22908 __struct.operator_location_type =
22909 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22910 enum_type: "MavOdidOperatorLocationType",
22911 value: tmp as u32,
22912 })?;
22913 let tmp = buf.get_u8();
22914 __struct.classification_type =
22915 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22916 enum_type: "MavOdidClassificationType",
22917 value: tmp as u32,
22918 })?;
22919 let tmp = buf.get_u8();
22920 __struct.category_eu =
22921 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22922 enum_type: "MavOdidCategoryEu",
22923 value: tmp as u32,
22924 })?;
22925 let tmp = buf.get_u8();
22926 __struct.class_eu =
22927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22928 enum_type: "MavOdidClassEu",
22929 value: tmp as u32,
22930 })?;
22931 Ok(__struct)
22932 }
22933 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22934 let mut __tmp = BytesMut::new(bytes);
22935 #[allow(clippy::absurd_extreme_comparisons)]
22936 #[allow(unused_comparisons)]
22937 if __tmp.remaining() < Self::ENCODED_LEN {
22938 panic!(
22939 "buffer is too small (need {} bytes, but got {})",
22940 Self::ENCODED_LEN,
22941 __tmp.remaining(),
22942 )
22943 }
22944 __tmp.put_i32_le(self.operator_latitude);
22945 __tmp.put_i32_le(self.operator_longitude);
22946 __tmp.put_f32_le(self.area_ceiling);
22947 __tmp.put_f32_le(self.area_floor);
22948 __tmp.put_f32_le(self.operator_altitude_geo);
22949 __tmp.put_u32_le(self.timestamp);
22950 __tmp.put_u16_le(self.area_count);
22951 __tmp.put_u16_le(self.area_radius);
22952 __tmp.put_u8(self.target_system);
22953 __tmp.put_u8(self.target_component);
22954 for val in &self.id_or_mac {
22955 __tmp.put_u8(*val);
22956 }
22957 __tmp.put_u8(self.operator_location_type as u8);
22958 __tmp.put_u8(self.classification_type as u8);
22959 __tmp.put_u8(self.category_eu as u8);
22960 __tmp.put_u8(self.class_eu as u8);
22961 if matches!(version, MavlinkVersion::V2) {
22962 let len = __tmp.len();
22963 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22964 } else {
22965 __tmp.len()
22966 }
22967 }
22968}
22969#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22970#[doc = ""]
22971#[doc = "ID: 12919"]
22972#[derive(Debug, Clone, PartialEq)]
22973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22974#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22975#[cfg_attr(feature = "ts", derive(TS))]
22976#[cfg_attr(feature = "ts", ts(export))]
22977pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22978 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22979 pub operator_latitude: i32,
22980 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22981 pub operator_longitude: i32,
22982 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22983 pub operator_altitude_geo: f32,
22984 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22985 pub timestamp: u32,
22986 #[doc = "System ID (0 for broadcast)."]
22987 pub target_system: u8,
22988 #[doc = "Component ID (0 for broadcast)."]
22989 pub target_component: u8,
22990}
22991impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22992 pub const ENCODED_LEN: usize = 18usize;
22993 pub const DEFAULT: Self = Self {
22994 operator_latitude: 0_i32,
22995 operator_longitude: 0_i32,
22996 operator_altitude_geo: 0.0_f32,
22997 timestamp: 0_u32,
22998 target_system: 0_u8,
22999 target_component: 0_u8,
23000 };
23001 #[cfg(feature = "arbitrary")]
23002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23003 use arbitrary::{Arbitrary, Unstructured};
23004 let mut buf = [0u8; 1024];
23005 rng.fill_bytes(&mut buf);
23006 let mut unstructured = Unstructured::new(&buf);
23007 Self::arbitrary(&mut unstructured).unwrap_or_default()
23008 }
23009}
23010impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23011 fn default() -> Self {
23012 Self::DEFAULT.clone()
23013 }
23014}
23015impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23016 type Message = MavMessage;
23017 const ID: u32 = 12919u32;
23018 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
23019 const EXTRA_CRC: u8 = 7u8;
23020 const ENCODED_LEN: usize = 18usize;
23021 fn deser(
23022 _version: MavlinkVersion,
23023 __input: &[u8],
23024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23025 let avail_len = __input.len();
23026 let mut payload_buf = [0; Self::ENCODED_LEN];
23027 let mut buf = if avail_len < Self::ENCODED_LEN {
23028 payload_buf[0..avail_len].copy_from_slice(__input);
23029 Bytes::new(&payload_buf)
23030 } else {
23031 Bytes::new(__input)
23032 };
23033 let mut __struct = Self::default();
23034 __struct.operator_latitude = buf.get_i32_le();
23035 __struct.operator_longitude = buf.get_i32_le();
23036 __struct.operator_altitude_geo = buf.get_f32_le();
23037 __struct.timestamp = buf.get_u32_le();
23038 __struct.target_system = buf.get_u8();
23039 __struct.target_component = buf.get_u8();
23040 Ok(__struct)
23041 }
23042 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23043 let mut __tmp = BytesMut::new(bytes);
23044 #[allow(clippy::absurd_extreme_comparisons)]
23045 #[allow(unused_comparisons)]
23046 if __tmp.remaining() < Self::ENCODED_LEN {
23047 panic!(
23048 "buffer is too small (need {} bytes, but got {})",
23049 Self::ENCODED_LEN,
23050 __tmp.remaining(),
23051 )
23052 }
23053 __tmp.put_i32_le(self.operator_latitude);
23054 __tmp.put_i32_le(self.operator_longitude);
23055 __tmp.put_f32_le(self.operator_altitude_geo);
23056 __tmp.put_u32_le(self.timestamp);
23057 __tmp.put_u8(self.target_system);
23058 __tmp.put_u8(self.target_component);
23059 if matches!(version, MavlinkVersion::V2) {
23060 let len = __tmp.len();
23061 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23062 } else {
23063 __tmp.len()
23064 }
23065 }
23066}
23067#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23068#[doc = ""]
23069#[doc = "ID: 100"]
23070#[derive(Debug, Clone, PartialEq)]
23071#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23072#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23073#[cfg_attr(feature = "ts", derive(TS))]
23074#[cfg_attr(feature = "ts", ts(export))]
23075pub struct OPTICAL_FLOW_DATA {
23076 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23077 pub time_usec: u64,
23078 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23079 pub flow_comp_m_x: f32,
23080 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23081 pub flow_comp_m_y: f32,
23082 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23083 pub ground_distance: f32,
23084 #[doc = "Flow in x-sensor direction"]
23085 pub flow_x: i16,
23086 #[doc = "Flow in y-sensor direction"]
23087 pub flow_y: i16,
23088 #[doc = "Sensor ID"]
23089 pub sensor_id: u8,
23090 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23091 pub quality: u8,
23092 #[doc = "Flow rate about X axis"]
23093 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23094 pub flow_rate_x: f32,
23095 #[doc = "Flow rate about Y axis"]
23096 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23097 pub flow_rate_y: f32,
23098}
23099impl OPTICAL_FLOW_DATA {
23100 pub const ENCODED_LEN: usize = 34usize;
23101 pub const DEFAULT: Self = Self {
23102 time_usec: 0_u64,
23103 flow_comp_m_x: 0.0_f32,
23104 flow_comp_m_y: 0.0_f32,
23105 ground_distance: 0.0_f32,
23106 flow_x: 0_i16,
23107 flow_y: 0_i16,
23108 sensor_id: 0_u8,
23109 quality: 0_u8,
23110 flow_rate_x: 0.0_f32,
23111 flow_rate_y: 0.0_f32,
23112 };
23113 #[cfg(feature = "arbitrary")]
23114 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23115 use arbitrary::{Arbitrary, Unstructured};
23116 let mut buf = [0u8; 1024];
23117 rng.fill_bytes(&mut buf);
23118 let mut unstructured = Unstructured::new(&buf);
23119 Self::arbitrary(&mut unstructured).unwrap_or_default()
23120 }
23121}
23122impl Default for OPTICAL_FLOW_DATA {
23123 fn default() -> Self {
23124 Self::DEFAULT.clone()
23125 }
23126}
23127impl MessageData for OPTICAL_FLOW_DATA {
23128 type Message = MavMessage;
23129 const ID: u32 = 100u32;
23130 const NAME: &'static str = "OPTICAL_FLOW";
23131 const EXTRA_CRC: u8 = 175u8;
23132 const ENCODED_LEN: usize = 34usize;
23133 fn deser(
23134 _version: MavlinkVersion,
23135 __input: &[u8],
23136 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23137 let avail_len = __input.len();
23138 let mut payload_buf = [0; Self::ENCODED_LEN];
23139 let mut buf = if avail_len < Self::ENCODED_LEN {
23140 payload_buf[0..avail_len].copy_from_slice(__input);
23141 Bytes::new(&payload_buf)
23142 } else {
23143 Bytes::new(__input)
23144 };
23145 let mut __struct = Self::default();
23146 __struct.time_usec = buf.get_u64_le();
23147 __struct.flow_comp_m_x = buf.get_f32_le();
23148 __struct.flow_comp_m_y = buf.get_f32_le();
23149 __struct.ground_distance = buf.get_f32_le();
23150 __struct.flow_x = buf.get_i16_le();
23151 __struct.flow_y = buf.get_i16_le();
23152 __struct.sensor_id = buf.get_u8();
23153 __struct.quality = buf.get_u8();
23154 __struct.flow_rate_x = buf.get_f32_le();
23155 __struct.flow_rate_y = buf.get_f32_le();
23156 Ok(__struct)
23157 }
23158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23159 let mut __tmp = BytesMut::new(bytes);
23160 #[allow(clippy::absurd_extreme_comparisons)]
23161 #[allow(unused_comparisons)]
23162 if __tmp.remaining() < Self::ENCODED_LEN {
23163 panic!(
23164 "buffer is too small (need {} bytes, but got {})",
23165 Self::ENCODED_LEN,
23166 __tmp.remaining(),
23167 )
23168 }
23169 __tmp.put_u64_le(self.time_usec);
23170 __tmp.put_f32_le(self.flow_comp_m_x);
23171 __tmp.put_f32_le(self.flow_comp_m_y);
23172 __tmp.put_f32_le(self.ground_distance);
23173 __tmp.put_i16_le(self.flow_x);
23174 __tmp.put_i16_le(self.flow_y);
23175 __tmp.put_u8(self.sensor_id);
23176 __tmp.put_u8(self.quality);
23177 if matches!(version, MavlinkVersion::V2) {
23178 __tmp.put_f32_le(self.flow_rate_x);
23179 __tmp.put_f32_le(self.flow_rate_y);
23180 let len = __tmp.len();
23181 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23182 } else {
23183 __tmp.len()
23184 }
23185 }
23186}
23187#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23188#[doc = ""]
23189#[doc = "ID: 106"]
23190#[derive(Debug, Clone, PartialEq)]
23191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23192#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23193#[cfg_attr(feature = "ts", derive(TS))]
23194#[cfg_attr(feature = "ts", ts(export))]
23195pub struct OPTICAL_FLOW_RAD_DATA {
23196 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23197 pub time_usec: u64,
23198 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23199 pub integration_time_us: u32,
23200 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23201 pub integrated_x: f32,
23202 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23203 pub integrated_y: f32,
23204 #[doc = "RH rotation around X axis"]
23205 pub integrated_xgyro: f32,
23206 #[doc = "RH rotation around Y axis"]
23207 pub integrated_ygyro: f32,
23208 #[doc = "RH rotation around Z axis"]
23209 pub integrated_zgyro: f32,
23210 #[doc = "Time since the distance was sampled."]
23211 pub time_delta_distance_us: u32,
23212 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23213 pub distance: f32,
23214 #[doc = "Temperature"]
23215 pub temperature: i16,
23216 #[doc = "Sensor ID"]
23217 pub sensor_id: u8,
23218 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23219 pub quality: u8,
23220}
23221impl OPTICAL_FLOW_RAD_DATA {
23222 pub const ENCODED_LEN: usize = 44usize;
23223 pub const DEFAULT: Self = Self {
23224 time_usec: 0_u64,
23225 integration_time_us: 0_u32,
23226 integrated_x: 0.0_f32,
23227 integrated_y: 0.0_f32,
23228 integrated_xgyro: 0.0_f32,
23229 integrated_ygyro: 0.0_f32,
23230 integrated_zgyro: 0.0_f32,
23231 time_delta_distance_us: 0_u32,
23232 distance: 0.0_f32,
23233 temperature: 0_i16,
23234 sensor_id: 0_u8,
23235 quality: 0_u8,
23236 };
23237 #[cfg(feature = "arbitrary")]
23238 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23239 use arbitrary::{Arbitrary, Unstructured};
23240 let mut buf = [0u8; 1024];
23241 rng.fill_bytes(&mut buf);
23242 let mut unstructured = Unstructured::new(&buf);
23243 Self::arbitrary(&mut unstructured).unwrap_or_default()
23244 }
23245}
23246impl Default for OPTICAL_FLOW_RAD_DATA {
23247 fn default() -> Self {
23248 Self::DEFAULT.clone()
23249 }
23250}
23251impl MessageData for OPTICAL_FLOW_RAD_DATA {
23252 type Message = MavMessage;
23253 const ID: u32 = 106u32;
23254 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23255 const EXTRA_CRC: u8 = 138u8;
23256 const ENCODED_LEN: usize = 44usize;
23257 fn deser(
23258 _version: MavlinkVersion,
23259 __input: &[u8],
23260 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23261 let avail_len = __input.len();
23262 let mut payload_buf = [0; Self::ENCODED_LEN];
23263 let mut buf = if avail_len < Self::ENCODED_LEN {
23264 payload_buf[0..avail_len].copy_from_slice(__input);
23265 Bytes::new(&payload_buf)
23266 } else {
23267 Bytes::new(__input)
23268 };
23269 let mut __struct = Self::default();
23270 __struct.time_usec = buf.get_u64_le();
23271 __struct.integration_time_us = buf.get_u32_le();
23272 __struct.integrated_x = buf.get_f32_le();
23273 __struct.integrated_y = buf.get_f32_le();
23274 __struct.integrated_xgyro = buf.get_f32_le();
23275 __struct.integrated_ygyro = buf.get_f32_le();
23276 __struct.integrated_zgyro = buf.get_f32_le();
23277 __struct.time_delta_distance_us = buf.get_u32_le();
23278 __struct.distance = buf.get_f32_le();
23279 __struct.temperature = buf.get_i16_le();
23280 __struct.sensor_id = buf.get_u8();
23281 __struct.quality = buf.get_u8();
23282 Ok(__struct)
23283 }
23284 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23285 let mut __tmp = BytesMut::new(bytes);
23286 #[allow(clippy::absurd_extreme_comparisons)]
23287 #[allow(unused_comparisons)]
23288 if __tmp.remaining() < Self::ENCODED_LEN {
23289 panic!(
23290 "buffer is too small (need {} bytes, but got {})",
23291 Self::ENCODED_LEN,
23292 __tmp.remaining(),
23293 )
23294 }
23295 __tmp.put_u64_le(self.time_usec);
23296 __tmp.put_u32_le(self.integration_time_us);
23297 __tmp.put_f32_le(self.integrated_x);
23298 __tmp.put_f32_le(self.integrated_y);
23299 __tmp.put_f32_le(self.integrated_xgyro);
23300 __tmp.put_f32_le(self.integrated_ygyro);
23301 __tmp.put_f32_le(self.integrated_zgyro);
23302 __tmp.put_u32_le(self.time_delta_distance_us);
23303 __tmp.put_f32_le(self.distance);
23304 __tmp.put_i16_le(self.temperature);
23305 __tmp.put_u8(self.sensor_id);
23306 __tmp.put_u8(self.quality);
23307 if matches!(version, MavlinkVersion::V2) {
23308 let len = __tmp.len();
23309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23310 } else {
23311 __tmp.len()
23312 }
23313 }
23314}
23315#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23316#[doc = ""]
23317#[doc = "ID: 360"]
23318#[derive(Debug, Clone, PartialEq)]
23319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23321#[cfg_attr(feature = "ts", derive(TS))]
23322#[cfg_attr(feature = "ts", ts(export))]
23323pub struct ORBIT_EXECUTION_STATUS_DATA {
23324 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23325 pub time_usec: u64,
23326 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23327 pub radius: f32,
23328 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23329 pub x: i32,
23330 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23331 pub y: i32,
23332 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23333 pub z: f32,
23334 #[doc = "The coordinate system of the fields: x, y, z."]
23335 pub frame: MavFrame,
23336}
23337impl ORBIT_EXECUTION_STATUS_DATA {
23338 pub const ENCODED_LEN: usize = 25usize;
23339 pub const DEFAULT: Self = Self {
23340 time_usec: 0_u64,
23341 radius: 0.0_f32,
23342 x: 0_i32,
23343 y: 0_i32,
23344 z: 0.0_f32,
23345 frame: MavFrame::DEFAULT,
23346 };
23347 #[cfg(feature = "arbitrary")]
23348 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23349 use arbitrary::{Arbitrary, Unstructured};
23350 let mut buf = [0u8; 1024];
23351 rng.fill_bytes(&mut buf);
23352 let mut unstructured = Unstructured::new(&buf);
23353 Self::arbitrary(&mut unstructured).unwrap_or_default()
23354 }
23355}
23356impl Default for ORBIT_EXECUTION_STATUS_DATA {
23357 fn default() -> Self {
23358 Self::DEFAULT.clone()
23359 }
23360}
23361impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23362 type Message = MavMessage;
23363 const ID: u32 = 360u32;
23364 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23365 const EXTRA_CRC: u8 = 11u8;
23366 const ENCODED_LEN: usize = 25usize;
23367 fn deser(
23368 _version: MavlinkVersion,
23369 __input: &[u8],
23370 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23371 let avail_len = __input.len();
23372 let mut payload_buf = [0; Self::ENCODED_LEN];
23373 let mut buf = if avail_len < Self::ENCODED_LEN {
23374 payload_buf[0..avail_len].copy_from_slice(__input);
23375 Bytes::new(&payload_buf)
23376 } else {
23377 Bytes::new(__input)
23378 };
23379 let mut __struct = Self::default();
23380 __struct.time_usec = buf.get_u64_le();
23381 __struct.radius = buf.get_f32_le();
23382 __struct.x = buf.get_i32_le();
23383 __struct.y = buf.get_i32_le();
23384 __struct.z = buf.get_f32_le();
23385 let tmp = buf.get_u8();
23386 __struct.frame =
23387 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23388 enum_type: "MavFrame",
23389 value: tmp as u32,
23390 })?;
23391 Ok(__struct)
23392 }
23393 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23394 let mut __tmp = BytesMut::new(bytes);
23395 #[allow(clippy::absurd_extreme_comparisons)]
23396 #[allow(unused_comparisons)]
23397 if __tmp.remaining() < Self::ENCODED_LEN {
23398 panic!(
23399 "buffer is too small (need {} bytes, but got {})",
23400 Self::ENCODED_LEN,
23401 __tmp.remaining(),
23402 )
23403 }
23404 __tmp.put_u64_le(self.time_usec);
23405 __tmp.put_f32_le(self.radius);
23406 __tmp.put_i32_le(self.x);
23407 __tmp.put_i32_le(self.y);
23408 __tmp.put_f32_le(self.z);
23409 __tmp.put_u8(self.frame as u8);
23410 if matches!(version, MavlinkVersion::V2) {
23411 let len = __tmp.len();
23412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23413 } else {
23414 __tmp.len()
23415 }
23416 }
23417}
23418#[doc = "Response from a PARAM_EXT_SET message."]
23419#[doc = ""]
23420#[doc = "ID: 324"]
23421#[derive(Debug, Clone, PartialEq)]
23422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23424#[cfg_attr(feature = "ts", derive(TS))]
23425#[cfg_attr(feature = "ts", ts(export))]
23426pub struct PARAM_EXT_ACK_DATA {
23427 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23428 #[cfg_attr(feature = "ts", ts(type = "string"))]
23429 pub param_id: CharArray<16>,
23430 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23431 #[cfg_attr(feature = "ts", ts(type = "string"))]
23432 pub param_value: CharArray<128>,
23433 #[doc = "Parameter type."]
23434 pub param_type: MavParamExtType,
23435 #[doc = "Result code."]
23436 pub param_result: ParamAck,
23437}
23438impl PARAM_EXT_ACK_DATA {
23439 pub const ENCODED_LEN: usize = 146usize;
23440 pub const DEFAULT: Self = Self {
23441 param_id: CharArray::new([0_u8; 16usize]),
23442 param_value: CharArray::new([0_u8; 128usize]),
23443 param_type: MavParamExtType::DEFAULT,
23444 param_result: ParamAck::DEFAULT,
23445 };
23446 #[cfg(feature = "arbitrary")]
23447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23448 use arbitrary::{Arbitrary, Unstructured};
23449 let mut buf = [0u8; 1024];
23450 rng.fill_bytes(&mut buf);
23451 let mut unstructured = Unstructured::new(&buf);
23452 Self::arbitrary(&mut unstructured).unwrap_or_default()
23453 }
23454}
23455impl Default for PARAM_EXT_ACK_DATA {
23456 fn default() -> Self {
23457 Self::DEFAULT.clone()
23458 }
23459}
23460impl MessageData for PARAM_EXT_ACK_DATA {
23461 type Message = MavMessage;
23462 const ID: u32 = 324u32;
23463 const NAME: &'static str = "PARAM_EXT_ACK";
23464 const EXTRA_CRC: u8 = 132u8;
23465 const ENCODED_LEN: usize = 146usize;
23466 fn deser(
23467 _version: MavlinkVersion,
23468 __input: &[u8],
23469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23470 let avail_len = __input.len();
23471 let mut payload_buf = [0; Self::ENCODED_LEN];
23472 let mut buf = if avail_len < Self::ENCODED_LEN {
23473 payload_buf[0..avail_len].copy_from_slice(__input);
23474 Bytes::new(&payload_buf)
23475 } else {
23476 Bytes::new(__input)
23477 };
23478 let mut __struct = Self::default();
23479 let mut tmp = [0_u8; 16usize];
23480 for v in &mut tmp {
23481 *v = buf.get_u8();
23482 }
23483 __struct.param_id = CharArray::new(tmp);
23484 let mut tmp = [0_u8; 128usize];
23485 for v in &mut tmp {
23486 *v = buf.get_u8();
23487 }
23488 __struct.param_value = CharArray::new(tmp);
23489 let tmp = buf.get_u8();
23490 __struct.param_type =
23491 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23492 enum_type: "MavParamExtType",
23493 value: tmp as u32,
23494 })?;
23495 let tmp = buf.get_u8();
23496 __struct.param_result =
23497 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23498 enum_type: "ParamAck",
23499 value: tmp as u32,
23500 })?;
23501 Ok(__struct)
23502 }
23503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23504 let mut __tmp = BytesMut::new(bytes);
23505 #[allow(clippy::absurd_extreme_comparisons)]
23506 #[allow(unused_comparisons)]
23507 if __tmp.remaining() < Self::ENCODED_LEN {
23508 panic!(
23509 "buffer is too small (need {} bytes, but got {})",
23510 Self::ENCODED_LEN,
23511 __tmp.remaining(),
23512 )
23513 }
23514 for val in &self.param_id {
23515 __tmp.put_u8(*val);
23516 }
23517 for val in &self.param_value {
23518 __tmp.put_u8(*val);
23519 }
23520 __tmp.put_u8(self.param_type as u8);
23521 __tmp.put_u8(self.param_result as u8);
23522 if matches!(version, MavlinkVersion::V2) {
23523 let len = __tmp.len();
23524 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23525 } else {
23526 __tmp.len()
23527 }
23528 }
23529}
23530#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23531#[doc = ""]
23532#[doc = "ID: 321"]
23533#[derive(Debug, Clone, PartialEq)]
23534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23536#[cfg_attr(feature = "ts", derive(TS))]
23537#[cfg_attr(feature = "ts", ts(export))]
23538pub struct PARAM_EXT_REQUEST_LIST_DATA {
23539 #[doc = "System ID"]
23540 pub target_system: u8,
23541 #[doc = "Component ID"]
23542 pub target_component: u8,
23543}
23544impl PARAM_EXT_REQUEST_LIST_DATA {
23545 pub const ENCODED_LEN: usize = 2usize;
23546 pub const DEFAULT: Self = Self {
23547 target_system: 0_u8,
23548 target_component: 0_u8,
23549 };
23550 #[cfg(feature = "arbitrary")]
23551 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23552 use arbitrary::{Arbitrary, Unstructured};
23553 let mut buf = [0u8; 1024];
23554 rng.fill_bytes(&mut buf);
23555 let mut unstructured = Unstructured::new(&buf);
23556 Self::arbitrary(&mut unstructured).unwrap_or_default()
23557 }
23558}
23559impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23560 fn default() -> Self {
23561 Self::DEFAULT.clone()
23562 }
23563}
23564impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23565 type Message = MavMessage;
23566 const ID: u32 = 321u32;
23567 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23568 const EXTRA_CRC: u8 = 88u8;
23569 const ENCODED_LEN: usize = 2usize;
23570 fn deser(
23571 _version: MavlinkVersion,
23572 __input: &[u8],
23573 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23574 let avail_len = __input.len();
23575 let mut payload_buf = [0; Self::ENCODED_LEN];
23576 let mut buf = if avail_len < Self::ENCODED_LEN {
23577 payload_buf[0..avail_len].copy_from_slice(__input);
23578 Bytes::new(&payload_buf)
23579 } else {
23580 Bytes::new(__input)
23581 };
23582 let mut __struct = Self::default();
23583 __struct.target_system = buf.get_u8();
23584 __struct.target_component = buf.get_u8();
23585 Ok(__struct)
23586 }
23587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23588 let mut __tmp = BytesMut::new(bytes);
23589 #[allow(clippy::absurd_extreme_comparisons)]
23590 #[allow(unused_comparisons)]
23591 if __tmp.remaining() < Self::ENCODED_LEN {
23592 panic!(
23593 "buffer is too small (need {} bytes, but got {})",
23594 Self::ENCODED_LEN,
23595 __tmp.remaining(),
23596 )
23597 }
23598 __tmp.put_u8(self.target_system);
23599 __tmp.put_u8(self.target_component);
23600 if matches!(version, MavlinkVersion::V2) {
23601 let len = __tmp.len();
23602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23603 } else {
23604 __tmp.len()
23605 }
23606 }
23607}
23608#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23609#[doc = ""]
23610#[doc = "ID: 320"]
23611#[derive(Debug, Clone, PartialEq)]
23612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23614#[cfg_attr(feature = "ts", derive(TS))]
23615#[cfg_attr(feature = "ts", ts(export))]
23616pub struct PARAM_EXT_REQUEST_READ_DATA {
23617 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23618 pub param_index: i16,
23619 #[doc = "System ID"]
23620 pub target_system: u8,
23621 #[doc = "Component ID"]
23622 pub target_component: u8,
23623 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23624 #[cfg_attr(feature = "ts", ts(type = "string"))]
23625 pub param_id: CharArray<16>,
23626}
23627impl PARAM_EXT_REQUEST_READ_DATA {
23628 pub const ENCODED_LEN: usize = 20usize;
23629 pub const DEFAULT: Self = Self {
23630 param_index: 0_i16,
23631 target_system: 0_u8,
23632 target_component: 0_u8,
23633 param_id: CharArray::new([0_u8; 16usize]),
23634 };
23635 #[cfg(feature = "arbitrary")]
23636 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23637 use arbitrary::{Arbitrary, Unstructured};
23638 let mut buf = [0u8; 1024];
23639 rng.fill_bytes(&mut buf);
23640 let mut unstructured = Unstructured::new(&buf);
23641 Self::arbitrary(&mut unstructured).unwrap_or_default()
23642 }
23643}
23644impl Default for PARAM_EXT_REQUEST_READ_DATA {
23645 fn default() -> Self {
23646 Self::DEFAULT.clone()
23647 }
23648}
23649impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23650 type Message = MavMessage;
23651 const ID: u32 = 320u32;
23652 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23653 const EXTRA_CRC: u8 = 243u8;
23654 const ENCODED_LEN: usize = 20usize;
23655 fn deser(
23656 _version: MavlinkVersion,
23657 __input: &[u8],
23658 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23659 let avail_len = __input.len();
23660 let mut payload_buf = [0; Self::ENCODED_LEN];
23661 let mut buf = if avail_len < Self::ENCODED_LEN {
23662 payload_buf[0..avail_len].copy_from_slice(__input);
23663 Bytes::new(&payload_buf)
23664 } else {
23665 Bytes::new(__input)
23666 };
23667 let mut __struct = Self::default();
23668 __struct.param_index = buf.get_i16_le();
23669 __struct.target_system = buf.get_u8();
23670 __struct.target_component = buf.get_u8();
23671 let mut tmp = [0_u8; 16usize];
23672 for v in &mut tmp {
23673 *v = buf.get_u8();
23674 }
23675 __struct.param_id = CharArray::new(tmp);
23676 Ok(__struct)
23677 }
23678 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23679 let mut __tmp = BytesMut::new(bytes);
23680 #[allow(clippy::absurd_extreme_comparisons)]
23681 #[allow(unused_comparisons)]
23682 if __tmp.remaining() < Self::ENCODED_LEN {
23683 panic!(
23684 "buffer is too small (need {} bytes, but got {})",
23685 Self::ENCODED_LEN,
23686 __tmp.remaining(),
23687 )
23688 }
23689 __tmp.put_i16_le(self.param_index);
23690 __tmp.put_u8(self.target_system);
23691 __tmp.put_u8(self.target_component);
23692 for val in &self.param_id {
23693 __tmp.put_u8(*val);
23694 }
23695 if matches!(version, MavlinkVersion::V2) {
23696 let len = __tmp.len();
23697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23698 } else {
23699 __tmp.len()
23700 }
23701 }
23702}
23703#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23704#[doc = ""]
23705#[doc = "ID: 323"]
23706#[derive(Debug, Clone, PartialEq)]
23707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23709#[cfg_attr(feature = "ts", derive(TS))]
23710#[cfg_attr(feature = "ts", ts(export))]
23711pub struct PARAM_EXT_SET_DATA {
23712 #[doc = "System ID"]
23713 pub target_system: u8,
23714 #[doc = "Component ID"]
23715 pub target_component: u8,
23716 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23717 #[cfg_attr(feature = "ts", ts(type = "string"))]
23718 pub param_id: CharArray<16>,
23719 #[doc = "Parameter value"]
23720 #[cfg_attr(feature = "ts", ts(type = "string"))]
23721 pub param_value: CharArray<128>,
23722 #[doc = "Parameter type."]
23723 pub param_type: MavParamExtType,
23724}
23725impl PARAM_EXT_SET_DATA {
23726 pub const ENCODED_LEN: usize = 147usize;
23727 pub const DEFAULT: Self = Self {
23728 target_system: 0_u8,
23729 target_component: 0_u8,
23730 param_id: CharArray::new([0_u8; 16usize]),
23731 param_value: CharArray::new([0_u8; 128usize]),
23732 param_type: MavParamExtType::DEFAULT,
23733 };
23734 #[cfg(feature = "arbitrary")]
23735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23736 use arbitrary::{Arbitrary, Unstructured};
23737 let mut buf = [0u8; 1024];
23738 rng.fill_bytes(&mut buf);
23739 let mut unstructured = Unstructured::new(&buf);
23740 Self::arbitrary(&mut unstructured).unwrap_or_default()
23741 }
23742}
23743impl Default for PARAM_EXT_SET_DATA {
23744 fn default() -> Self {
23745 Self::DEFAULT.clone()
23746 }
23747}
23748impl MessageData for PARAM_EXT_SET_DATA {
23749 type Message = MavMessage;
23750 const ID: u32 = 323u32;
23751 const NAME: &'static str = "PARAM_EXT_SET";
23752 const EXTRA_CRC: u8 = 78u8;
23753 const ENCODED_LEN: usize = 147usize;
23754 fn deser(
23755 _version: MavlinkVersion,
23756 __input: &[u8],
23757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23758 let avail_len = __input.len();
23759 let mut payload_buf = [0; Self::ENCODED_LEN];
23760 let mut buf = if avail_len < Self::ENCODED_LEN {
23761 payload_buf[0..avail_len].copy_from_slice(__input);
23762 Bytes::new(&payload_buf)
23763 } else {
23764 Bytes::new(__input)
23765 };
23766 let mut __struct = Self::default();
23767 __struct.target_system = buf.get_u8();
23768 __struct.target_component = buf.get_u8();
23769 let mut tmp = [0_u8; 16usize];
23770 for v in &mut tmp {
23771 *v = buf.get_u8();
23772 }
23773 __struct.param_id = CharArray::new(tmp);
23774 let mut tmp = [0_u8; 128usize];
23775 for v in &mut tmp {
23776 *v = buf.get_u8();
23777 }
23778 __struct.param_value = CharArray::new(tmp);
23779 let tmp = buf.get_u8();
23780 __struct.param_type =
23781 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23782 enum_type: "MavParamExtType",
23783 value: tmp as u32,
23784 })?;
23785 Ok(__struct)
23786 }
23787 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23788 let mut __tmp = BytesMut::new(bytes);
23789 #[allow(clippy::absurd_extreme_comparisons)]
23790 #[allow(unused_comparisons)]
23791 if __tmp.remaining() < Self::ENCODED_LEN {
23792 panic!(
23793 "buffer is too small (need {} bytes, but got {})",
23794 Self::ENCODED_LEN,
23795 __tmp.remaining(),
23796 )
23797 }
23798 __tmp.put_u8(self.target_system);
23799 __tmp.put_u8(self.target_component);
23800 for val in &self.param_id {
23801 __tmp.put_u8(*val);
23802 }
23803 for val in &self.param_value {
23804 __tmp.put_u8(*val);
23805 }
23806 __tmp.put_u8(self.param_type as u8);
23807 if matches!(version, MavlinkVersion::V2) {
23808 let len = __tmp.len();
23809 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23810 } else {
23811 __tmp.len()
23812 }
23813 }
23814}
23815#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23816#[doc = ""]
23817#[doc = "ID: 322"]
23818#[derive(Debug, Clone, PartialEq)]
23819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23821#[cfg_attr(feature = "ts", derive(TS))]
23822#[cfg_attr(feature = "ts", ts(export))]
23823pub struct PARAM_EXT_VALUE_DATA {
23824 #[doc = "Total number of parameters"]
23825 pub param_count: u16,
23826 #[doc = "Index of this parameter"]
23827 pub param_index: u16,
23828 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23829 #[cfg_attr(feature = "ts", ts(type = "string"))]
23830 pub param_id: CharArray<16>,
23831 #[doc = "Parameter value"]
23832 #[cfg_attr(feature = "ts", ts(type = "string"))]
23833 pub param_value: CharArray<128>,
23834 #[doc = "Parameter type."]
23835 pub param_type: MavParamExtType,
23836}
23837impl PARAM_EXT_VALUE_DATA {
23838 pub const ENCODED_LEN: usize = 149usize;
23839 pub const DEFAULT: Self = Self {
23840 param_count: 0_u16,
23841 param_index: 0_u16,
23842 param_id: CharArray::new([0_u8; 16usize]),
23843 param_value: CharArray::new([0_u8; 128usize]),
23844 param_type: MavParamExtType::DEFAULT,
23845 };
23846 #[cfg(feature = "arbitrary")]
23847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23848 use arbitrary::{Arbitrary, Unstructured};
23849 let mut buf = [0u8; 1024];
23850 rng.fill_bytes(&mut buf);
23851 let mut unstructured = Unstructured::new(&buf);
23852 Self::arbitrary(&mut unstructured).unwrap_or_default()
23853 }
23854}
23855impl Default for PARAM_EXT_VALUE_DATA {
23856 fn default() -> Self {
23857 Self::DEFAULT.clone()
23858 }
23859}
23860impl MessageData for PARAM_EXT_VALUE_DATA {
23861 type Message = MavMessage;
23862 const ID: u32 = 322u32;
23863 const NAME: &'static str = "PARAM_EXT_VALUE";
23864 const EXTRA_CRC: u8 = 243u8;
23865 const ENCODED_LEN: usize = 149usize;
23866 fn deser(
23867 _version: MavlinkVersion,
23868 __input: &[u8],
23869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23870 let avail_len = __input.len();
23871 let mut payload_buf = [0; Self::ENCODED_LEN];
23872 let mut buf = if avail_len < Self::ENCODED_LEN {
23873 payload_buf[0..avail_len].copy_from_slice(__input);
23874 Bytes::new(&payload_buf)
23875 } else {
23876 Bytes::new(__input)
23877 };
23878 let mut __struct = Self::default();
23879 __struct.param_count = buf.get_u16_le();
23880 __struct.param_index = buf.get_u16_le();
23881 let mut tmp = [0_u8; 16usize];
23882 for v in &mut tmp {
23883 *v = buf.get_u8();
23884 }
23885 __struct.param_id = CharArray::new(tmp);
23886 let mut tmp = [0_u8; 128usize];
23887 for v in &mut tmp {
23888 *v = buf.get_u8();
23889 }
23890 __struct.param_value = CharArray::new(tmp);
23891 let tmp = buf.get_u8();
23892 __struct.param_type =
23893 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23894 enum_type: "MavParamExtType",
23895 value: tmp as u32,
23896 })?;
23897 Ok(__struct)
23898 }
23899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23900 let mut __tmp = BytesMut::new(bytes);
23901 #[allow(clippy::absurd_extreme_comparisons)]
23902 #[allow(unused_comparisons)]
23903 if __tmp.remaining() < Self::ENCODED_LEN {
23904 panic!(
23905 "buffer is too small (need {} bytes, but got {})",
23906 Self::ENCODED_LEN,
23907 __tmp.remaining(),
23908 )
23909 }
23910 __tmp.put_u16_le(self.param_count);
23911 __tmp.put_u16_le(self.param_index);
23912 for val in &self.param_id {
23913 __tmp.put_u8(*val);
23914 }
23915 for val in &self.param_value {
23916 __tmp.put_u8(*val);
23917 }
23918 __tmp.put_u8(self.param_type as u8);
23919 if matches!(version, MavlinkVersion::V2) {
23920 let len = __tmp.len();
23921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23922 } else {
23923 __tmp.len()
23924 }
23925 }
23926}
23927#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23928#[doc = ""]
23929#[doc = "ID: 50"]
23930#[derive(Debug, Clone, PartialEq)]
23931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23933#[cfg_attr(feature = "ts", derive(TS))]
23934#[cfg_attr(feature = "ts", ts(export))]
23935pub struct PARAM_MAP_RC_DATA {
23936 #[doc = "Initial parameter value"]
23937 pub param_value0: f32,
23938 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23939 pub scale: f32,
23940 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23941 pub param_value_min: f32,
23942 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23943 pub param_value_max: f32,
23944 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23945 pub param_index: i16,
23946 #[doc = "System ID"]
23947 pub target_system: u8,
23948 #[doc = "Component ID"]
23949 pub target_component: u8,
23950 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23951 #[cfg_attr(feature = "ts", ts(type = "string"))]
23952 pub param_id: CharArray<16>,
23953 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23954 pub parameter_rc_channel_index: u8,
23955}
23956impl PARAM_MAP_RC_DATA {
23957 pub const ENCODED_LEN: usize = 37usize;
23958 pub const DEFAULT: Self = Self {
23959 param_value0: 0.0_f32,
23960 scale: 0.0_f32,
23961 param_value_min: 0.0_f32,
23962 param_value_max: 0.0_f32,
23963 param_index: 0_i16,
23964 target_system: 0_u8,
23965 target_component: 0_u8,
23966 param_id: CharArray::new([0_u8; 16usize]),
23967 parameter_rc_channel_index: 0_u8,
23968 };
23969 #[cfg(feature = "arbitrary")]
23970 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23971 use arbitrary::{Arbitrary, Unstructured};
23972 let mut buf = [0u8; 1024];
23973 rng.fill_bytes(&mut buf);
23974 let mut unstructured = Unstructured::new(&buf);
23975 Self::arbitrary(&mut unstructured).unwrap_or_default()
23976 }
23977}
23978impl Default for PARAM_MAP_RC_DATA {
23979 fn default() -> Self {
23980 Self::DEFAULT.clone()
23981 }
23982}
23983impl MessageData for PARAM_MAP_RC_DATA {
23984 type Message = MavMessage;
23985 const ID: u32 = 50u32;
23986 const NAME: &'static str = "PARAM_MAP_RC";
23987 const EXTRA_CRC: u8 = 78u8;
23988 const ENCODED_LEN: usize = 37usize;
23989 fn deser(
23990 _version: MavlinkVersion,
23991 __input: &[u8],
23992 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23993 let avail_len = __input.len();
23994 let mut payload_buf = [0; Self::ENCODED_LEN];
23995 let mut buf = if avail_len < Self::ENCODED_LEN {
23996 payload_buf[0..avail_len].copy_from_slice(__input);
23997 Bytes::new(&payload_buf)
23998 } else {
23999 Bytes::new(__input)
24000 };
24001 let mut __struct = Self::default();
24002 __struct.param_value0 = buf.get_f32_le();
24003 __struct.scale = buf.get_f32_le();
24004 __struct.param_value_min = buf.get_f32_le();
24005 __struct.param_value_max = buf.get_f32_le();
24006 __struct.param_index = buf.get_i16_le();
24007 __struct.target_system = buf.get_u8();
24008 __struct.target_component = buf.get_u8();
24009 let mut tmp = [0_u8; 16usize];
24010 for v in &mut tmp {
24011 *v = buf.get_u8();
24012 }
24013 __struct.param_id = CharArray::new(tmp);
24014 __struct.parameter_rc_channel_index = buf.get_u8();
24015 Ok(__struct)
24016 }
24017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24018 let mut __tmp = BytesMut::new(bytes);
24019 #[allow(clippy::absurd_extreme_comparisons)]
24020 #[allow(unused_comparisons)]
24021 if __tmp.remaining() < Self::ENCODED_LEN {
24022 panic!(
24023 "buffer is too small (need {} bytes, but got {})",
24024 Self::ENCODED_LEN,
24025 __tmp.remaining(),
24026 )
24027 }
24028 __tmp.put_f32_le(self.param_value0);
24029 __tmp.put_f32_le(self.scale);
24030 __tmp.put_f32_le(self.param_value_min);
24031 __tmp.put_f32_le(self.param_value_max);
24032 __tmp.put_i16_le(self.param_index);
24033 __tmp.put_u8(self.target_system);
24034 __tmp.put_u8(self.target_component);
24035 for val in &self.param_id {
24036 __tmp.put_u8(*val);
24037 }
24038 __tmp.put_u8(self.parameter_rc_channel_index);
24039 if matches!(version, MavlinkVersion::V2) {
24040 let len = __tmp.len();
24041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24042 } else {
24043 __tmp.len()
24044 }
24045 }
24046}
24047#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24048#[doc = ""]
24049#[doc = "ID: 21"]
24050#[derive(Debug, Clone, PartialEq)]
24051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24053#[cfg_attr(feature = "ts", derive(TS))]
24054#[cfg_attr(feature = "ts", ts(export))]
24055pub struct PARAM_REQUEST_LIST_DATA {
24056 #[doc = "System ID"]
24057 pub target_system: u8,
24058 #[doc = "Component ID"]
24059 pub target_component: u8,
24060}
24061impl PARAM_REQUEST_LIST_DATA {
24062 pub const ENCODED_LEN: usize = 2usize;
24063 pub const DEFAULT: Self = Self {
24064 target_system: 0_u8,
24065 target_component: 0_u8,
24066 };
24067 #[cfg(feature = "arbitrary")]
24068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24069 use arbitrary::{Arbitrary, Unstructured};
24070 let mut buf = [0u8; 1024];
24071 rng.fill_bytes(&mut buf);
24072 let mut unstructured = Unstructured::new(&buf);
24073 Self::arbitrary(&mut unstructured).unwrap_or_default()
24074 }
24075}
24076impl Default for PARAM_REQUEST_LIST_DATA {
24077 fn default() -> Self {
24078 Self::DEFAULT.clone()
24079 }
24080}
24081impl MessageData for PARAM_REQUEST_LIST_DATA {
24082 type Message = MavMessage;
24083 const ID: u32 = 21u32;
24084 const NAME: &'static str = "PARAM_REQUEST_LIST";
24085 const EXTRA_CRC: u8 = 159u8;
24086 const ENCODED_LEN: usize = 2usize;
24087 fn deser(
24088 _version: MavlinkVersion,
24089 __input: &[u8],
24090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24091 let avail_len = __input.len();
24092 let mut payload_buf = [0; Self::ENCODED_LEN];
24093 let mut buf = if avail_len < Self::ENCODED_LEN {
24094 payload_buf[0..avail_len].copy_from_slice(__input);
24095 Bytes::new(&payload_buf)
24096 } else {
24097 Bytes::new(__input)
24098 };
24099 let mut __struct = Self::default();
24100 __struct.target_system = buf.get_u8();
24101 __struct.target_component = buf.get_u8();
24102 Ok(__struct)
24103 }
24104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24105 let mut __tmp = BytesMut::new(bytes);
24106 #[allow(clippy::absurd_extreme_comparisons)]
24107 #[allow(unused_comparisons)]
24108 if __tmp.remaining() < Self::ENCODED_LEN {
24109 panic!(
24110 "buffer is too small (need {} bytes, but got {})",
24111 Self::ENCODED_LEN,
24112 __tmp.remaining(),
24113 )
24114 }
24115 __tmp.put_u8(self.target_system);
24116 __tmp.put_u8(self.target_component);
24117 if matches!(version, MavlinkVersion::V2) {
24118 let len = __tmp.len();
24119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24120 } else {
24121 __tmp.len()
24122 }
24123 }
24124}
24125#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24126#[doc = ""]
24127#[doc = "ID: 20"]
24128#[derive(Debug, Clone, PartialEq)]
24129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24131#[cfg_attr(feature = "ts", derive(TS))]
24132#[cfg_attr(feature = "ts", ts(export))]
24133pub struct PARAM_REQUEST_READ_DATA {
24134 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24135 pub param_index: i16,
24136 #[doc = "System ID"]
24137 pub target_system: u8,
24138 #[doc = "Component ID"]
24139 pub target_component: u8,
24140 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24141 #[cfg_attr(feature = "ts", ts(type = "string"))]
24142 pub param_id: CharArray<16>,
24143}
24144impl PARAM_REQUEST_READ_DATA {
24145 pub const ENCODED_LEN: usize = 20usize;
24146 pub const DEFAULT: Self = Self {
24147 param_index: 0_i16,
24148 target_system: 0_u8,
24149 target_component: 0_u8,
24150 param_id: CharArray::new([0_u8; 16usize]),
24151 };
24152 #[cfg(feature = "arbitrary")]
24153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24154 use arbitrary::{Arbitrary, Unstructured};
24155 let mut buf = [0u8; 1024];
24156 rng.fill_bytes(&mut buf);
24157 let mut unstructured = Unstructured::new(&buf);
24158 Self::arbitrary(&mut unstructured).unwrap_or_default()
24159 }
24160}
24161impl Default for PARAM_REQUEST_READ_DATA {
24162 fn default() -> Self {
24163 Self::DEFAULT.clone()
24164 }
24165}
24166impl MessageData for PARAM_REQUEST_READ_DATA {
24167 type Message = MavMessage;
24168 const ID: u32 = 20u32;
24169 const NAME: &'static str = "PARAM_REQUEST_READ";
24170 const EXTRA_CRC: u8 = 214u8;
24171 const ENCODED_LEN: usize = 20usize;
24172 fn deser(
24173 _version: MavlinkVersion,
24174 __input: &[u8],
24175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24176 let avail_len = __input.len();
24177 let mut payload_buf = [0; Self::ENCODED_LEN];
24178 let mut buf = if avail_len < Self::ENCODED_LEN {
24179 payload_buf[0..avail_len].copy_from_slice(__input);
24180 Bytes::new(&payload_buf)
24181 } else {
24182 Bytes::new(__input)
24183 };
24184 let mut __struct = Self::default();
24185 __struct.param_index = buf.get_i16_le();
24186 __struct.target_system = buf.get_u8();
24187 __struct.target_component = buf.get_u8();
24188 let mut tmp = [0_u8; 16usize];
24189 for v in &mut tmp {
24190 *v = buf.get_u8();
24191 }
24192 __struct.param_id = CharArray::new(tmp);
24193 Ok(__struct)
24194 }
24195 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24196 let mut __tmp = BytesMut::new(bytes);
24197 #[allow(clippy::absurd_extreme_comparisons)]
24198 #[allow(unused_comparisons)]
24199 if __tmp.remaining() < Self::ENCODED_LEN {
24200 panic!(
24201 "buffer is too small (need {} bytes, but got {})",
24202 Self::ENCODED_LEN,
24203 __tmp.remaining(),
24204 )
24205 }
24206 __tmp.put_i16_le(self.param_index);
24207 __tmp.put_u8(self.target_system);
24208 __tmp.put_u8(self.target_component);
24209 for val in &self.param_id {
24210 __tmp.put_u8(*val);
24211 }
24212 if matches!(version, MavlinkVersion::V2) {
24213 let len = __tmp.len();
24214 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24215 } else {
24216 __tmp.len()
24217 }
24218 }
24219}
24220#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24221#[doc = ""]
24222#[doc = "ID: 23"]
24223#[derive(Debug, Clone, PartialEq)]
24224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24226#[cfg_attr(feature = "ts", derive(TS))]
24227#[cfg_attr(feature = "ts", ts(export))]
24228pub struct PARAM_SET_DATA {
24229 #[doc = "Onboard parameter value"]
24230 pub param_value: f32,
24231 #[doc = "System ID"]
24232 pub target_system: u8,
24233 #[doc = "Component ID"]
24234 pub target_component: u8,
24235 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24236 #[cfg_attr(feature = "ts", ts(type = "string"))]
24237 pub param_id: CharArray<16>,
24238 #[doc = "Onboard parameter type."]
24239 pub param_type: MavParamType,
24240}
24241impl PARAM_SET_DATA {
24242 pub const ENCODED_LEN: usize = 23usize;
24243 pub const DEFAULT: Self = Self {
24244 param_value: 0.0_f32,
24245 target_system: 0_u8,
24246 target_component: 0_u8,
24247 param_id: CharArray::new([0_u8; 16usize]),
24248 param_type: MavParamType::DEFAULT,
24249 };
24250 #[cfg(feature = "arbitrary")]
24251 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24252 use arbitrary::{Arbitrary, Unstructured};
24253 let mut buf = [0u8; 1024];
24254 rng.fill_bytes(&mut buf);
24255 let mut unstructured = Unstructured::new(&buf);
24256 Self::arbitrary(&mut unstructured).unwrap_or_default()
24257 }
24258}
24259impl Default for PARAM_SET_DATA {
24260 fn default() -> Self {
24261 Self::DEFAULT.clone()
24262 }
24263}
24264impl MessageData for PARAM_SET_DATA {
24265 type Message = MavMessage;
24266 const ID: u32 = 23u32;
24267 const NAME: &'static str = "PARAM_SET";
24268 const EXTRA_CRC: u8 = 168u8;
24269 const ENCODED_LEN: usize = 23usize;
24270 fn deser(
24271 _version: MavlinkVersion,
24272 __input: &[u8],
24273 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24274 let avail_len = __input.len();
24275 let mut payload_buf = [0; Self::ENCODED_LEN];
24276 let mut buf = if avail_len < Self::ENCODED_LEN {
24277 payload_buf[0..avail_len].copy_from_slice(__input);
24278 Bytes::new(&payload_buf)
24279 } else {
24280 Bytes::new(__input)
24281 };
24282 let mut __struct = Self::default();
24283 __struct.param_value = buf.get_f32_le();
24284 __struct.target_system = buf.get_u8();
24285 __struct.target_component = buf.get_u8();
24286 let mut tmp = [0_u8; 16usize];
24287 for v in &mut tmp {
24288 *v = buf.get_u8();
24289 }
24290 __struct.param_id = CharArray::new(tmp);
24291 let tmp = buf.get_u8();
24292 __struct.param_type =
24293 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24294 enum_type: "MavParamType",
24295 value: tmp as u32,
24296 })?;
24297 Ok(__struct)
24298 }
24299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24300 let mut __tmp = BytesMut::new(bytes);
24301 #[allow(clippy::absurd_extreme_comparisons)]
24302 #[allow(unused_comparisons)]
24303 if __tmp.remaining() < Self::ENCODED_LEN {
24304 panic!(
24305 "buffer is too small (need {} bytes, but got {})",
24306 Self::ENCODED_LEN,
24307 __tmp.remaining(),
24308 )
24309 }
24310 __tmp.put_f32_le(self.param_value);
24311 __tmp.put_u8(self.target_system);
24312 __tmp.put_u8(self.target_component);
24313 for val in &self.param_id {
24314 __tmp.put_u8(*val);
24315 }
24316 __tmp.put_u8(self.param_type as u8);
24317 if matches!(version, MavlinkVersion::V2) {
24318 let len = __tmp.len();
24319 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24320 } else {
24321 __tmp.len()
24322 }
24323 }
24324}
24325#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24326#[doc = ""]
24327#[doc = "ID: 22"]
24328#[derive(Debug, Clone, PartialEq)]
24329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24331#[cfg_attr(feature = "ts", derive(TS))]
24332#[cfg_attr(feature = "ts", ts(export))]
24333pub struct PARAM_VALUE_DATA {
24334 #[doc = "Onboard parameter value"]
24335 pub param_value: f32,
24336 #[doc = "Total number of onboard parameters"]
24337 pub param_count: u16,
24338 #[doc = "Index of this onboard parameter"]
24339 pub param_index: u16,
24340 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24341 #[cfg_attr(feature = "ts", ts(type = "string"))]
24342 pub param_id: CharArray<16>,
24343 #[doc = "Onboard parameter type."]
24344 pub param_type: MavParamType,
24345}
24346impl PARAM_VALUE_DATA {
24347 pub const ENCODED_LEN: usize = 25usize;
24348 pub const DEFAULT: Self = Self {
24349 param_value: 0.0_f32,
24350 param_count: 0_u16,
24351 param_index: 0_u16,
24352 param_id: CharArray::new([0_u8; 16usize]),
24353 param_type: MavParamType::DEFAULT,
24354 };
24355 #[cfg(feature = "arbitrary")]
24356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24357 use arbitrary::{Arbitrary, Unstructured};
24358 let mut buf = [0u8; 1024];
24359 rng.fill_bytes(&mut buf);
24360 let mut unstructured = Unstructured::new(&buf);
24361 Self::arbitrary(&mut unstructured).unwrap_or_default()
24362 }
24363}
24364impl Default for PARAM_VALUE_DATA {
24365 fn default() -> Self {
24366 Self::DEFAULT.clone()
24367 }
24368}
24369impl MessageData for PARAM_VALUE_DATA {
24370 type Message = MavMessage;
24371 const ID: u32 = 22u32;
24372 const NAME: &'static str = "PARAM_VALUE";
24373 const EXTRA_CRC: u8 = 220u8;
24374 const ENCODED_LEN: usize = 25usize;
24375 fn deser(
24376 _version: MavlinkVersion,
24377 __input: &[u8],
24378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24379 let avail_len = __input.len();
24380 let mut payload_buf = [0; Self::ENCODED_LEN];
24381 let mut buf = if avail_len < Self::ENCODED_LEN {
24382 payload_buf[0..avail_len].copy_from_slice(__input);
24383 Bytes::new(&payload_buf)
24384 } else {
24385 Bytes::new(__input)
24386 };
24387 let mut __struct = Self::default();
24388 __struct.param_value = buf.get_f32_le();
24389 __struct.param_count = buf.get_u16_le();
24390 __struct.param_index = buf.get_u16_le();
24391 let mut tmp = [0_u8; 16usize];
24392 for v in &mut tmp {
24393 *v = buf.get_u8();
24394 }
24395 __struct.param_id = CharArray::new(tmp);
24396 let tmp = buf.get_u8();
24397 __struct.param_type =
24398 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24399 enum_type: "MavParamType",
24400 value: tmp as u32,
24401 })?;
24402 Ok(__struct)
24403 }
24404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24405 let mut __tmp = BytesMut::new(bytes);
24406 #[allow(clippy::absurd_extreme_comparisons)]
24407 #[allow(unused_comparisons)]
24408 if __tmp.remaining() < Self::ENCODED_LEN {
24409 panic!(
24410 "buffer is too small (need {} bytes, but got {})",
24411 Self::ENCODED_LEN,
24412 __tmp.remaining(),
24413 )
24414 }
24415 __tmp.put_f32_le(self.param_value);
24416 __tmp.put_u16_le(self.param_count);
24417 __tmp.put_u16_le(self.param_index);
24418 for val in &self.param_id {
24419 __tmp.put_u8(*val);
24420 }
24421 __tmp.put_u8(self.param_type as u8);
24422 if matches!(version, MavlinkVersion::V2) {
24423 let len = __tmp.len();
24424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24425 } else {
24426 __tmp.len()
24427 }
24428 }
24429}
24430#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24431#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24432#[doc = ""]
24433#[doc = "ID: 4"]
24434#[derive(Debug, Clone, PartialEq)]
24435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24437#[cfg_attr(feature = "ts", derive(TS))]
24438#[cfg_attr(feature = "ts", ts(export))]
24439pub struct PING_DATA {
24440 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24441 pub time_usec: u64,
24442 #[doc = "PING sequence"]
24443 pub seq: u32,
24444 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24445 pub target_system: u8,
24446 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24447 pub target_component: u8,
24448}
24449impl PING_DATA {
24450 pub const ENCODED_LEN: usize = 14usize;
24451 pub const DEFAULT: Self = Self {
24452 time_usec: 0_u64,
24453 seq: 0_u32,
24454 target_system: 0_u8,
24455 target_component: 0_u8,
24456 };
24457 #[cfg(feature = "arbitrary")]
24458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24459 use arbitrary::{Arbitrary, Unstructured};
24460 let mut buf = [0u8; 1024];
24461 rng.fill_bytes(&mut buf);
24462 let mut unstructured = Unstructured::new(&buf);
24463 Self::arbitrary(&mut unstructured).unwrap_or_default()
24464 }
24465}
24466impl Default for PING_DATA {
24467 fn default() -> Self {
24468 Self::DEFAULT.clone()
24469 }
24470}
24471impl MessageData for PING_DATA {
24472 type Message = MavMessage;
24473 const ID: u32 = 4u32;
24474 const NAME: &'static str = "PING";
24475 const EXTRA_CRC: u8 = 237u8;
24476 const ENCODED_LEN: usize = 14usize;
24477 fn deser(
24478 _version: MavlinkVersion,
24479 __input: &[u8],
24480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24481 let avail_len = __input.len();
24482 let mut payload_buf = [0; Self::ENCODED_LEN];
24483 let mut buf = if avail_len < Self::ENCODED_LEN {
24484 payload_buf[0..avail_len].copy_from_slice(__input);
24485 Bytes::new(&payload_buf)
24486 } else {
24487 Bytes::new(__input)
24488 };
24489 let mut __struct = Self::default();
24490 __struct.time_usec = buf.get_u64_le();
24491 __struct.seq = buf.get_u32_le();
24492 __struct.target_system = buf.get_u8();
24493 __struct.target_component = buf.get_u8();
24494 Ok(__struct)
24495 }
24496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24497 let mut __tmp = BytesMut::new(bytes);
24498 #[allow(clippy::absurd_extreme_comparisons)]
24499 #[allow(unused_comparisons)]
24500 if __tmp.remaining() < Self::ENCODED_LEN {
24501 panic!(
24502 "buffer is too small (need {} bytes, but got {})",
24503 Self::ENCODED_LEN,
24504 __tmp.remaining(),
24505 )
24506 }
24507 __tmp.put_u64_le(self.time_usec);
24508 __tmp.put_u32_le(self.seq);
24509 __tmp.put_u8(self.target_system);
24510 __tmp.put_u8(self.target_component);
24511 if matches!(version, MavlinkVersion::V2) {
24512 let len = __tmp.len();
24513 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24514 } else {
24515 __tmp.len()
24516 }
24517 }
24518}
24519#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24520#[doc = "Control vehicle tone generation (buzzer)."]
24521#[doc = ""]
24522#[doc = "ID: 258"]
24523#[derive(Debug, Clone, PartialEq)]
24524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24526#[cfg_attr(feature = "ts", derive(TS))]
24527#[cfg_attr(feature = "ts", ts(export))]
24528pub struct PLAY_TUNE_DATA {
24529 #[doc = "System ID"]
24530 pub target_system: u8,
24531 #[doc = "Component ID"]
24532 pub target_component: u8,
24533 #[doc = "tune in board specific format"]
24534 #[cfg_attr(feature = "ts", ts(type = "string"))]
24535 pub tune: CharArray<30>,
24536 #[doc = "tune extension (appended to tune)"]
24537 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24538 #[cfg_attr(feature = "ts", ts(type = "string"))]
24539 pub tune2: CharArray<200>,
24540}
24541impl PLAY_TUNE_DATA {
24542 pub const ENCODED_LEN: usize = 232usize;
24543 pub const DEFAULT: Self = Self {
24544 target_system: 0_u8,
24545 target_component: 0_u8,
24546 tune: CharArray::new([0_u8; 30usize]),
24547 tune2: CharArray::new([0_u8; 200usize]),
24548 };
24549 #[cfg(feature = "arbitrary")]
24550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24551 use arbitrary::{Arbitrary, Unstructured};
24552 let mut buf = [0u8; 1024];
24553 rng.fill_bytes(&mut buf);
24554 let mut unstructured = Unstructured::new(&buf);
24555 Self::arbitrary(&mut unstructured).unwrap_or_default()
24556 }
24557}
24558impl Default for PLAY_TUNE_DATA {
24559 fn default() -> Self {
24560 Self::DEFAULT.clone()
24561 }
24562}
24563impl MessageData for PLAY_TUNE_DATA {
24564 type Message = MavMessage;
24565 const ID: u32 = 258u32;
24566 const NAME: &'static str = "PLAY_TUNE";
24567 const EXTRA_CRC: u8 = 187u8;
24568 const ENCODED_LEN: usize = 232usize;
24569 fn deser(
24570 _version: MavlinkVersion,
24571 __input: &[u8],
24572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24573 let avail_len = __input.len();
24574 let mut payload_buf = [0; Self::ENCODED_LEN];
24575 let mut buf = if avail_len < Self::ENCODED_LEN {
24576 payload_buf[0..avail_len].copy_from_slice(__input);
24577 Bytes::new(&payload_buf)
24578 } else {
24579 Bytes::new(__input)
24580 };
24581 let mut __struct = Self::default();
24582 __struct.target_system = buf.get_u8();
24583 __struct.target_component = buf.get_u8();
24584 let mut tmp = [0_u8; 30usize];
24585 for v in &mut tmp {
24586 *v = buf.get_u8();
24587 }
24588 __struct.tune = CharArray::new(tmp);
24589 let mut tmp = [0_u8; 200usize];
24590 for v in &mut tmp {
24591 *v = buf.get_u8();
24592 }
24593 __struct.tune2 = CharArray::new(tmp);
24594 Ok(__struct)
24595 }
24596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24597 let mut __tmp = BytesMut::new(bytes);
24598 #[allow(clippy::absurd_extreme_comparisons)]
24599 #[allow(unused_comparisons)]
24600 if __tmp.remaining() < Self::ENCODED_LEN {
24601 panic!(
24602 "buffer is too small (need {} bytes, but got {})",
24603 Self::ENCODED_LEN,
24604 __tmp.remaining(),
24605 )
24606 }
24607 __tmp.put_u8(self.target_system);
24608 __tmp.put_u8(self.target_component);
24609 for val in &self.tune {
24610 __tmp.put_u8(*val);
24611 }
24612 if matches!(version, MavlinkVersion::V2) {
24613 for val in &self.tune2 {
24614 __tmp.put_u8(*val);
24615 }
24616 let len = __tmp.len();
24617 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24618 } else {
24619 __tmp.len()
24620 }
24621 }
24622}
24623#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24624#[doc = ""]
24625#[doc = "ID: 400"]
24626#[derive(Debug, Clone, PartialEq)]
24627#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24629#[cfg_attr(feature = "ts", derive(TS))]
24630#[cfg_attr(feature = "ts", ts(export))]
24631pub struct PLAY_TUNE_V2_DATA {
24632 #[doc = "Tune format"]
24633 pub format: TuneFormat,
24634 #[doc = "System ID"]
24635 pub target_system: u8,
24636 #[doc = "Component ID"]
24637 pub target_component: u8,
24638 #[doc = "Tune definition as a NULL-terminated string."]
24639 #[cfg_attr(feature = "ts", ts(type = "string"))]
24640 pub tune: CharArray<248>,
24641}
24642impl PLAY_TUNE_V2_DATA {
24643 pub const ENCODED_LEN: usize = 254usize;
24644 pub const DEFAULT: Self = Self {
24645 format: TuneFormat::DEFAULT,
24646 target_system: 0_u8,
24647 target_component: 0_u8,
24648 tune: CharArray::new([0_u8; 248usize]),
24649 };
24650 #[cfg(feature = "arbitrary")]
24651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24652 use arbitrary::{Arbitrary, Unstructured};
24653 let mut buf = [0u8; 1024];
24654 rng.fill_bytes(&mut buf);
24655 let mut unstructured = Unstructured::new(&buf);
24656 Self::arbitrary(&mut unstructured).unwrap_or_default()
24657 }
24658}
24659impl Default for PLAY_TUNE_V2_DATA {
24660 fn default() -> Self {
24661 Self::DEFAULT.clone()
24662 }
24663}
24664impl MessageData for PLAY_TUNE_V2_DATA {
24665 type Message = MavMessage;
24666 const ID: u32 = 400u32;
24667 const NAME: &'static str = "PLAY_TUNE_V2";
24668 const EXTRA_CRC: u8 = 110u8;
24669 const ENCODED_LEN: usize = 254usize;
24670 fn deser(
24671 _version: MavlinkVersion,
24672 __input: &[u8],
24673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24674 let avail_len = __input.len();
24675 let mut payload_buf = [0; Self::ENCODED_LEN];
24676 let mut buf = if avail_len < Self::ENCODED_LEN {
24677 payload_buf[0..avail_len].copy_from_slice(__input);
24678 Bytes::new(&payload_buf)
24679 } else {
24680 Bytes::new(__input)
24681 };
24682 let mut __struct = Self::default();
24683 let tmp = buf.get_u32_le();
24684 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24685 ::mavlink_core::error::ParserError::InvalidEnum {
24686 enum_type: "TuneFormat",
24687 value: tmp as u32,
24688 },
24689 )?;
24690 __struct.target_system = buf.get_u8();
24691 __struct.target_component = buf.get_u8();
24692 let mut tmp = [0_u8; 248usize];
24693 for v in &mut tmp {
24694 *v = buf.get_u8();
24695 }
24696 __struct.tune = CharArray::new(tmp);
24697 Ok(__struct)
24698 }
24699 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24700 let mut __tmp = BytesMut::new(bytes);
24701 #[allow(clippy::absurd_extreme_comparisons)]
24702 #[allow(unused_comparisons)]
24703 if __tmp.remaining() < Self::ENCODED_LEN {
24704 panic!(
24705 "buffer is too small (need {} bytes, but got {})",
24706 Self::ENCODED_LEN,
24707 __tmp.remaining(),
24708 )
24709 }
24710 __tmp.put_u32_le(self.format as u32);
24711 __tmp.put_u8(self.target_system);
24712 __tmp.put_u8(self.target_component);
24713 for val in &self.tune {
24714 __tmp.put_u8(*val);
24715 }
24716 if matches!(version, MavlinkVersion::V2) {
24717 let len = __tmp.len();
24718 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24719 } else {
24720 __tmp.len()
24721 }
24722 }
24723}
24724#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24725#[doc = ""]
24726#[doc = "ID: 87"]
24727#[derive(Debug, Clone, PartialEq)]
24728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24730#[cfg_attr(feature = "ts", derive(TS))]
24731#[cfg_attr(feature = "ts", ts(export))]
24732pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24733 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24734 pub time_boot_ms: u32,
24735 #[doc = "Latitude in WGS84 frame"]
24736 pub lat_int: i32,
24737 #[doc = "Longitude in WGS84 frame"]
24738 pub lon_int: i32,
24739 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24740 pub alt: f32,
24741 #[doc = "X velocity in NED frame"]
24742 pub vx: f32,
24743 #[doc = "Y velocity in NED frame"]
24744 pub vy: f32,
24745 #[doc = "Z velocity in NED frame"]
24746 pub vz: f32,
24747 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24748 pub afx: f32,
24749 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24750 pub afy: f32,
24751 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24752 pub afz: f32,
24753 #[doc = "yaw setpoint"]
24754 pub yaw: f32,
24755 #[doc = "yaw rate setpoint"]
24756 pub yaw_rate: f32,
24757 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24758 pub type_mask: PositionTargetTypemask,
24759 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24760 pub coordinate_frame: MavFrame,
24761}
24762impl POSITION_TARGET_GLOBAL_INT_DATA {
24763 pub const ENCODED_LEN: usize = 51usize;
24764 pub const DEFAULT: Self = Self {
24765 time_boot_ms: 0_u32,
24766 lat_int: 0_i32,
24767 lon_int: 0_i32,
24768 alt: 0.0_f32,
24769 vx: 0.0_f32,
24770 vy: 0.0_f32,
24771 vz: 0.0_f32,
24772 afx: 0.0_f32,
24773 afy: 0.0_f32,
24774 afz: 0.0_f32,
24775 yaw: 0.0_f32,
24776 yaw_rate: 0.0_f32,
24777 type_mask: PositionTargetTypemask::DEFAULT,
24778 coordinate_frame: MavFrame::DEFAULT,
24779 };
24780 #[cfg(feature = "arbitrary")]
24781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24782 use arbitrary::{Arbitrary, Unstructured};
24783 let mut buf = [0u8; 1024];
24784 rng.fill_bytes(&mut buf);
24785 let mut unstructured = Unstructured::new(&buf);
24786 Self::arbitrary(&mut unstructured).unwrap_or_default()
24787 }
24788}
24789impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24790 fn default() -> Self {
24791 Self::DEFAULT.clone()
24792 }
24793}
24794impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24795 type Message = MavMessage;
24796 const ID: u32 = 87u32;
24797 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24798 const EXTRA_CRC: u8 = 150u8;
24799 const ENCODED_LEN: usize = 51usize;
24800 fn deser(
24801 _version: MavlinkVersion,
24802 __input: &[u8],
24803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24804 let avail_len = __input.len();
24805 let mut payload_buf = [0; Self::ENCODED_LEN];
24806 let mut buf = if avail_len < Self::ENCODED_LEN {
24807 payload_buf[0..avail_len].copy_from_slice(__input);
24808 Bytes::new(&payload_buf)
24809 } else {
24810 Bytes::new(__input)
24811 };
24812 let mut __struct = Self::default();
24813 __struct.time_boot_ms = buf.get_u32_le();
24814 __struct.lat_int = buf.get_i32_le();
24815 __struct.lon_int = buf.get_i32_le();
24816 __struct.alt = buf.get_f32_le();
24817 __struct.vx = buf.get_f32_le();
24818 __struct.vy = buf.get_f32_le();
24819 __struct.vz = buf.get_f32_le();
24820 __struct.afx = buf.get_f32_le();
24821 __struct.afy = buf.get_f32_le();
24822 __struct.afz = buf.get_f32_le();
24823 __struct.yaw = buf.get_f32_le();
24824 __struct.yaw_rate = buf.get_f32_le();
24825 let tmp = buf.get_u16_le();
24826 __struct.type_mask = PositionTargetTypemask::from_bits(
24827 tmp & PositionTargetTypemask::all().bits(),
24828 )
24829 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24830 flag_type: "PositionTargetTypemask",
24831 value: tmp as u32,
24832 })?;
24833 let tmp = buf.get_u8();
24834 __struct.coordinate_frame =
24835 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24836 enum_type: "MavFrame",
24837 value: tmp as u32,
24838 })?;
24839 Ok(__struct)
24840 }
24841 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24842 let mut __tmp = BytesMut::new(bytes);
24843 #[allow(clippy::absurd_extreme_comparisons)]
24844 #[allow(unused_comparisons)]
24845 if __tmp.remaining() < Self::ENCODED_LEN {
24846 panic!(
24847 "buffer is too small (need {} bytes, but got {})",
24848 Self::ENCODED_LEN,
24849 __tmp.remaining(),
24850 )
24851 }
24852 __tmp.put_u32_le(self.time_boot_ms);
24853 __tmp.put_i32_le(self.lat_int);
24854 __tmp.put_i32_le(self.lon_int);
24855 __tmp.put_f32_le(self.alt);
24856 __tmp.put_f32_le(self.vx);
24857 __tmp.put_f32_le(self.vy);
24858 __tmp.put_f32_le(self.vz);
24859 __tmp.put_f32_le(self.afx);
24860 __tmp.put_f32_le(self.afy);
24861 __tmp.put_f32_le(self.afz);
24862 __tmp.put_f32_le(self.yaw);
24863 __tmp.put_f32_le(self.yaw_rate);
24864 __tmp.put_u16_le(self.type_mask.bits());
24865 __tmp.put_u8(self.coordinate_frame as u8);
24866 if matches!(version, MavlinkVersion::V2) {
24867 let len = __tmp.len();
24868 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24869 } else {
24870 __tmp.len()
24871 }
24872 }
24873}
24874#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24875#[doc = ""]
24876#[doc = "ID: 85"]
24877#[derive(Debug, Clone, PartialEq)]
24878#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24879#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24880#[cfg_attr(feature = "ts", derive(TS))]
24881#[cfg_attr(feature = "ts", ts(export))]
24882pub struct POSITION_TARGET_LOCAL_NED_DATA {
24883 #[doc = "Timestamp (time since system boot)."]
24884 pub time_boot_ms: u32,
24885 #[doc = "X Position in NED frame"]
24886 pub x: f32,
24887 #[doc = "Y Position in NED frame"]
24888 pub y: f32,
24889 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24890 pub z: f32,
24891 #[doc = "X velocity in NED frame"]
24892 pub vx: f32,
24893 #[doc = "Y velocity in NED frame"]
24894 pub vy: f32,
24895 #[doc = "Z velocity in NED frame"]
24896 pub vz: f32,
24897 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24898 pub afx: f32,
24899 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24900 pub afy: f32,
24901 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24902 pub afz: f32,
24903 #[doc = "yaw setpoint"]
24904 pub yaw: f32,
24905 #[doc = "yaw rate setpoint"]
24906 pub yaw_rate: f32,
24907 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24908 pub type_mask: PositionTargetTypemask,
24909 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24910 pub coordinate_frame: MavFrame,
24911}
24912impl POSITION_TARGET_LOCAL_NED_DATA {
24913 pub const ENCODED_LEN: usize = 51usize;
24914 pub const DEFAULT: Self = Self {
24915 time_boot_ms: 0_u32,
24916 x: 0.0_f32,
24917 y: 0.0_f32,
24918 z: 0.0_f32,
24919 vx: 0.0_f32,
24920 vy: 0.0_f32,
24921 vz: 0.0_f32,
24922 afx: 0.0_f32,
24923 afy: 0.0_f32,
24924 afz: 0.0_f32,
24925 yaw: 0.0_f32,
24926 yaw_rate: 0.0_f32,
24927 type_mask: PositionTargetTypemask::DEFAULT,
24928 coordinate_frame: MavFrame::DEFAULT,
24929 };
24930 #[cfg(feature = "arbitrary")]
24931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24932 use arbitrary::{Arbitrary, Unstructured};
24933 let mut buf = [0u8; 1024];
24934 rng.fill_bytes(&mut buf);
24935 let mut unstructured = Unstructured::new(&buf);
24936 Self::arbitrary(&mut unstructured).unwrap_or_default()
24937 }
24938}
24939impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24940 fn default() -> Self {
24941 Self::DEFAULT.clone()
24942 }
24943}
24944impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24945 type Message = MavMessage;
24946 const ID: u32 = 85u32;
24947 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24948 const EXTRA_CRC: u8 = 140u8;
24949 const ENCODED_LEN: usize = 51usize;
24950 fn deser(
24951 _version: MavlinkVersion,
24952 __input: &[u8],
24953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24954 let avail_len = __input.len();
24955 let mut payload_buf = [0; Self::ENCODED_LEN];
24956 let mut buf = if avail_len < Self::ENCODED_LEN {
24957 payload_buf[0..avail_len].copy_from_slice(__input);
24958 Bytes::new(&payload_buf)
24959 } else {
24960 Bytes::new(__input)
24961 };
24962 let mut __struct = Self::default();
24963 __struct.time_boot_ms = buf.get_u32_le();
24964 __struct.x = buf.get_f32_le();
24965 __struct.y = buf.get_f32_le();
24966 __struct.z = buf.get_f32_le();
24967 __struct.vx = buf.get_f32_le();
24968 __struct.vy = buf.get_f32_le();
24969 __struct.vz = buf.get_f32_le();
24970 __struct.afx = buf.get_f32_le();
24971 __struct.afy = buf.get_f32_le();
24972 __struct.afz = buf.get_f32_le();
24973 __struct.yaw = buf.get_f32_le();
24974 __struct.yaw_rate = buf.get_f32_le();
24975 let tmp = buf.get_u16_le();
24976 __struct.type_mask = PositionTargetTypemask::from_bits(
24977 tmp & PositionTargetTypemask::all().bits(),
24978 )
24979 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24980 flag_type: "PositionTargetTypemask",
24981 value: tmp as u32,
24982 })?;
24983 let tmp = buf.get_u8();
24984 __struct.coordinate_frame =
24985 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24986 enum_type: "MavFrame",
24987 value: tmp as u32,
24988 })?;
24989 Ok(__struct)
24990 }
24991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24992 let mut __tmp = BytesMut::new(bytes);
24993 #[allow(clippy::absurd_extreme_comparisons)]
24994 #[allow(unused_comparisons)]
24995 if __tmp.remaining() < Self::ENCODED_LEN {
24996 panic!(
24997 "buffer is too small (need {} bytes, but got {})",
24998 Self::ENCODED_LEN,
24999 __tmp.remaining(),
25000 )
25001 }
25002 __tmp.put_u32_le(self.time_boot_ms);
25003 __tmp.put_f32_le(self.x);
25004 __tmp.put_f32_le(self.y);
25005 __tmp.put_f32_le(self.z);
25006 __tmp.put_f32_le(self.vx);
25007 __tmp.put_f32_le(self.vy);
25008 __tmp.put_f32_le(self.vz);
25009 __tmp.put_f32_le(self.afx);
25010 __tmp.put_f32_le(self.afy);
25011 __tmp.put_f32_le(self.afz);
25012 __tmp.put_f32_le(self.yaw);
25013 __tmp.put_f32_le(self.yaw_rate);
25014 __tmp.put_u16_le(self.type_mask.bits());
25015 __tmp.put_u8(self.coordinate_frame as u8);
25016 if matches!(version, MavlinkVersion::V2) {
25017 let len = __tmp.len();
25018 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25019 } else {
25020 __tmp.len()
25021 }
25022 }
25023}
25024#[doc = "Power supply status."]
25025#[doc = ""]
25026#[doc = "ID: 125"]
25027#[derive(Debug, Clone, PartialEq)]
25028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25029#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25030#[cfg_attr(feature = "ts", derive(TS))]
25031#[cfg_attr(feature = "ts", ts(export))]
25032pub struct POWER_STATUS_DATA {
25033 #[doc = "5V rail voltage."]
25034 pub Vcc: u16,
25035 #[doc = "Servo rail voltage."]
25036 pub Vservo: u16,
25037 #[doc = "Bitmap of power supply status flags."]
25038 pub flags: MavPowerStatus,
25039}
25040impl POWER_STATUS_DATA {
25041 pub const ENCODED_LEN: usize = 6usize;
25042 pub const DEFAULT: Self = Self {
25043 Vcc: 0_u16,
25044 Vservo: 0_u16,
25045 flags: MavPowerStatus::DEFAULT,
25046 };
25047 #[cfg(feature = "arbitrary")]
25048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25049 use arbitrary::{Arbitrary, Unstructured};
25050 let mut buf = [0u8; 1024];
25051 rng.fill_bytes(&mut buf);
25052 let mut unstructured = Unstructured::new(&buf);
25053 Self::arbitrary(&mut unstructured).unwrap_or_default()
25054 }
25055}
25056impl Default for POWER_STATUS_DATA {
25057 fn default() -> Self {
25058 Self::DEFAULT.clone()
25059 }
25060}
25061impl MessageData for POWER_STATUS_DATA {
25062 type Message = MavMessage;
25063 const ID: u32 = 125u32;
25064 const NAME: &'static str = "POWER_STATUS";
25065 const EXTRA_CRC: u8 = 203u8;
25066 const ENCODED_LEN: usize = 6usize;
25067 fn deser(
25068 _version: MavlinkVersion,
25069 __input: &[u8],
25070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25071 let avail_len = __input.len();
25072 let mut payload_buf = [0; Self::ENCODED_LEN];
25073 let mut buf = if avail_len < Self::ENCODED_LEN {
25074 payload_buf[0..avail_len].copy_from_slice(__input);
25075 Bytes::new(&payload_buf)
25076 } else {
25077 Bytes::new(__input)
25078 };
25079 let mut __struct = Self::default();
25080 __struct.Vcc = buf.get_u16_le();
25081 __struct.Vservo = buf.get_u16_le();
25082 let tmp = buf.get_u16_le();
25083 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
25084 ::mavlink_core::error::ParserError::InvalidFlag {
25085 flag_type: "MavPowerStatus",
25086 value: tmp as u32,
25087 },
25088 )?;
25089 Ok(__struct)
25090 }
25091 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25092 let mut __tmp = BytesMut::new(bytes);
25093 #[allow(clippy::absurd_extreme_comparisons)]
25094 #[allow(unused_comparisons)]
25095 if __tmp.remaining() < Self::ENCODED_LEN {
25096 panic!(
25097 "buffer is too small (need {} bytes, but got {})",
25098 Self::ENCODED_LEN,
25099 __tmp.remaining(),
25100 )
25101 }
25102 __tmp.put_u16_le(self.Vcc);
25103 __tmp.put_u16_le(self.Vservo);
25104 __tmp.put_u16_le(self.flags.bits());
25105 if matches!(version, MavlinkVersion::V2) {
25106 let len = __tmp.len();
25107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25108 } else {
25109 __tmp.len()
25110 }
25111 }
25112}
25113#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25114#[doc = ""]
25115#[doc = "ID: 300"]
25116#[derive(Debug, Clone, PartialEq)]
25117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25119#[cfg_attr(feature = "ts", derive(TS))]
25120#[cfg_attr(feature = "ts", ts(export))]
25121pub struct PROTOCOL_VERSION_DATA {
25122 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25123 pub version: u16,
25124 #[doc = "Minimum MAVLink version supported"]
25125 pub min_version: u16,
25126 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25127 pub max_version: u16,
25128 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25129 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25130 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25131 pub spec_version_hash: [u8; 8],
25132 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25133 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25134 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25135 pub library_version_hash: [u8; 8],
25136}
25137impl PROTOCOL_VERSION_DATA {
25138 pub const ENCODED_LEN: usize = 22usize;
25139 pub const DEFAULT: Self = Self {
25140 version: 0_u16,
25141 min_version: 0_u16,
25142 max_version: 0_u16,
25143 spec_version_hash: [0_u8; 8usize],
25144 library_version_hash: [0_u8; 8usize],
25145 };
25146 #[cfg(feature = "arbitrary")]
25147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25148 use arbitrary::{Arbitrary, Unstructured};
25149 let mut buf = [0u8; 1024];
25150 rng.fill_bytes(&mut buf);
25151 let mut unstructured = Unstructured::new(&buf);
25152 Self::arbitrary(&mut unstructured).unwrap_or_default()
25153 }
25154}
25155impl Default for PROTOCOL_VERSION_DATA {
25156 fn default() -> Self {
25157 Self::DEFAULT.clone()
25158 }
25159}
25160impl MessageData for PROTOCOL_VERSION_DATA {
25161 type Message = MavMessage;
25162 const ID: u32 = 300u32;
25163 const NAME: &'static str = "PROTOCOL_VERSION";
25164 const EXTRA_CRC: u8 = 217u8;
25165 const ENCODED_LEN: usize = 22usize;
25166 fn deser(
25167 _version: MavlinkVersion,
25168 __input: &[u8],
25169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25170 let avail_len = __input.len();
25171 let mut payload_buf = [0; Self::ENCODED_LEN];
25172 let mut buf = if avail_len < Self::ENCODED_LEN {
25173 payload_buf[0..avail_len].copy_from_slice(__input);
25174 Bytes::new(&payload_buf)
25175 } else {
25176 Bytes::new(__input)
25177 };
25178 let mut __struct = Self::default();
25179 __struct.version = buf.get_u16_le();
25180 __struct.min_version = buf.get_u16_le();
25181 __struct.max_version = buf.get_u16_le();
25182 for v in &mut __struct.spec_version_hash {
25183 let val = buf.get_u8();
25184 *v = val;
25185 }
25186 for v in &mut __struct.library_version_hash {
25187 let val = buf.get_u8();
25188 *v = val;
25189 }
25190 Ok(__struct)
25191 }
25192 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25193 let mut __tmp = BytesMut::new(bytes);
25194 #[allow(clippy::absurd_extreme_comparisons)]
25195 #[allow(unused_comparisons)]
25196 if __tmp.remaining() < Self::ENCODED_LEN {
25197 panic!(
25198 "buffer is too small (need {} bytes, but got {})",
25199 Self::ENCODED_LEN,
25200 __tmp.remaining(),
25201 )
25202 }
25203 __tmp.put_u16_le(self.version);
25204 __tmp.put_u16_le(self.min_version);
25205 __tmp.put_u16_le(self.max_version);
25206 for val in &self.spec_version_hash {
25207 __tmp.put_u8(*val);
25208 }
25209 for val in &self.library_version_hash {
25210 __tmp.put_u8(*val);
25211 }
25212 if matches!(version, MavlinkVersion::V2) {
25213 let len = __tmp.len();
25214 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25215 } else {
25216 __tmp.len()
25217 }
25218 }
25219}
25220#[doc = "Status generated by radio and injected into MAVLink stream."]
25221#[doc = ""]
25222#[doc = "ID: 109"]
25223#[derive(Debug, Clone, PartialEq)]
25224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25226#[cfg_attr(feature = "ts", derive(TS))]
25227#[cfg_attr(feature = "ts", ts(export))]
25228pub struct RADIO_STATUS_DATA {
25229 #[doc = "Count of radio packet receive errors (since boot)."]
25230 pub rxerrors: u16,
25231 #[doc = "Count of error corrected radio packets (since boot)."]
25232 pub fixed: u16,
25233 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25234 pub rssi: u8,
25235 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25236 pub remrssi: u8,
25237 #[doc = "Remaining free transmitter buffer space."]
25238 pub txbuf: u8,
25239 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25240 pub noise: u8,
25241 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25242 pub remnoise: u8,
25243}
25244impl RADIO_STATUS_DATA {
25245 pub const ENCODED_LEN: usize = 9usize;
25246 pub const DEFAULT: Self = Self {
25247 rxerrors: 0_u16,
25248 fixed: 0_u16,
25249 rssi: 0_u8,
25250 remrssi: 0_u8,
25251 txbuf: 0_u8,
25252 noise: 0_u8,
25253 remnoise: 0_u8,
25254 };
25255 #[cfg(feature = "arbitrary")]
25256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25257 use arbitrary::{Arbitrary, Unstructured};
25258 let mut buf = [0u8; 1024];
25259 rng.fill_bytes(&mut buf);
25260 let mut unstructured = Unstructured::new(&buf);
25261 Self::arbitrary(&mut unstructured).unwrap_or_default()
25262 }
25263}
25264impl Default for RADIO_STATUS_DATA {
25265 fn default() -> Self {
25266 Self::DEFAULT.clone()
25267 }
25268}
25269impl MessageData for RADIO_STATUS_DATA {
25270 type Message = MavMessage;
25271 const ID: u32 = 109u32;
25272 const NAME: &'static str = "RADIO_STATUS";
25273 const EXTRA_CRC: u8 = 185u8;
25274 const ENCODED_LEN: usize = 9usize;
25275 fn deser(
25276 _version: MavlinkVersion,
25277 __input: &[u8],
25278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25279 let avail_len = __input.len();
25280 let mut payload_buf = [0; Self::ENCODED_LEN];
25281 let mut buf = if avail_len < Self::ENCODED_LEN {
25282 payload_buf[0..avail_len].copy_from_slice(__input);
25283 Bytes::new(&payload_buf)
25284 } else {
25285 Bytes::new(__input)
25286 };
25287 let mut __struct = Self::default();
25288 __struct.rxerrors = buf.get_u16_le();
25289 __struct.fixed = buf.get_u16_le();
25290 __struct.rssi = buf.get_u8();
25291 __struct.remrssi = buf.get_u8();
25292 __struct.txbuf = buf.get_u8();
25293 __struct.noise = buf.get_u8();
25294 __struct.remnoise = buf.get_u8();
25295 Ok(__struct)
25296 }
25297 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25298 let mut __tmp = BytesMut::new(bytes);
25299 #[allow(clippy::absurd_extreme_comparisons)]
25300 #[allow(unused_comparisons)]
25301 if __tmp.remaining() < Self::ENCODED_LEN {
25302 panic!(
25303 "buffer is too small (need {} bytes, but got {})",
25304 Self::ENCODED_LEN,
25305 __tmp.remaining(),
25306 )
25307 }
25308 __tmp.put_u16_le(self.rxerrors);
25309 __tmp.put_u16_le(self.fixed);
25310 __tmp.put_u8(self.rssi);
25311 __tmp.put_u8(self.remrssi);
25312 __tmp.put_u8(self.txbuf);
25313 __tmp.put_u8(self.noise);
25314 __tmp.put_u8(self.remnoise);
25315 if matches!(version, MavlinkVersion::V2) {
25316 let len = __tmp.len();
25317 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25318 } else {
25319 __tmp.len()
25320 }
25321 }
25322}
25323#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25324#[doc = ""]
25325#[doc = "ID: 27"]
25326#[derive(Debug, Clone, PartialEq)]
25327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25329#[cfg_attr(feature = "ts", derive(TS))]
25330#[cfg_attr(feature = "ts", ts(export))]
25331pub struct RAW_IMU_DATA {
25332 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25333 pub time_usec: u64,
25334 #[doc = "X acceleration (raw)"]
25335 pub xacc: i16,
25336 #[doc = "Y acceleration (raw)"]
25337 pub yacc: i16,
25338 #[doc = "Z acceleration (raw)"]
25339 pub zacc: i16,
25340 #[doc = "Angular speed around X axis (raw)"]
25341 pub xgyro: i16,
25342 #[doc = "Angular speed around Y axis (raw)"]
25343 pub ygyro: i16,
25344 #[doc = "Angular speed around Z axis (raw)"]
25345 pub zgyro: i16,
25346 #[doc = "X Magnetic field (raw)"]
25347 pub xmag: i16,
25348 #[doc = "Y Magnetic field (raw)"]
25349 pub ymag: i16,
25350 #[doc = "Z Magnetic field (raw)"]
25351 pub zmag: i16,
25352 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25353 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25354 pub id: u8,
25355 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25356 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25357 pub temperature: i16,
25358}
25359impl RAW_IMU_DATA {
25360 pub const ENCODED_LEN: usize = 29usize;
25361 pub const DEFAULT: Self = Self {
25362 time_usec: 0_u64,
25363 xacc: 0_i16,
25364 yacc: 0_i16,
25365 zacc: 0_i16,
25366 xgyro: 0_i16,
25367 ygyro: 0_i16,
25368 zgyro: 0_i16,
25369 xmag: 0_i16,
25370 ymag: 0_i16,
25371 zmag: 0_i16,
25372 id: 0_u8,
25373 temperature: 0_i16,
25374 };
25375 #[cfg(feature = "arbitrary")]
25376 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25377 use arbitrary::{Arbitrary, Unstructured};
25378 let mut buf = [0u8; 1024];
25379 rng.fill_bytes(&mut buf);
25380 let mut unstructured = Unstructured::new(&buf);
25381 Self::arbitrary(&mut unstructured).unwrap_or_default()
25382 }
25383}
25384impl Default for RAW_IMU_DATA {
25385 fn default() -> Self {
25386 Self::DEFAULT.clone()
25387 }
25388}
25389impl MessageData for RAW_IMU_DATA {
25390 type Message = MavMessage;
25391 const ID: u32 = 27u32;
25392 const NAME: &'static str = "RAW_IMU";
25393 const EXTRA_CRC: u8 = 144u8;
25394 const ENCODED_LEN: usize = 29usize;
25395 fn deser(
25396 _version: MavlinkVersion,
25397 __input: &[u8],
25398 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25399 let avail_len = __input.len();
25400 let mut payload_buf = [0; Self::ENCODED_LEN];
25401 let mut buf = if avail_len < Self::ENCODED_LEN {
25402 payload_buf[0..avail_len].copy_from_slice(__input);
25403 Bytes::new(&payload_buf)
25404 } else {
25405 Bytes::new(__input)
25406 };
25407 let mut __struct = Self::default();
25408 __struct.time_usec = buf.get_u64_le();
25409 __struct.xacc = buf.get_i16_le();
25410 __struct.yacc = buf.get_i16_le();
25411 __struct.zacc = buf.get_i16_le();
25412 __struct.xgyro = buf.get_i16_le();
25413 __struct.ygyro = buf.get_i16_le();
25414 __struct.zgyro = buf.get_i16_le();
25415 __struct.xmag = buf.get_i16_le();
25416 __struct.ymag = buf.get_i16_le();
25417 __struct.zmag = buf.get_i16_le();
25418 __struct.id = buf.get_u8();
25419 __struct.temperature = buf.get_i16_le();
25420 Ok(__struct)
25421 }
25422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25423 let mut __tmp = BytesMut::new(bytes);
25424 #[allow(clippy::absurd_extreme_comparisons)]
25425 #[allow(unused_comparisons)]
25426 if __tmp.remaining() < Self::ENCODED_LEN {
25427 panic!(
25428 "buffer is too small (need {} bytes, but got {})",
25429 Self::ENCODED_LEN,
25430 __tmp.remaining(),
25431 )
25432 }
25433 __tmp.put_u64_le(self.time_usec);
25434 __tmp.put_i16_le(self.xacc);
25435 __tmp.put_i16_le(self.yacc);
25436 __tmp.put_i16_le(self.zacc);
25437 __tmp.put_i16_le(self.xgyro);
25438 __tmp.put_i16_le(self.ygyro);
25439 __tmp.put_i16_le(self.zgyro);
25440 __tmp.put_i16_le(self.xmag);
25441 __tmp.put_i16_le(self.ymag);
25442 __tmp.put_i16_le(self.zmag);
25443 if matches!(version, MavlinkVersion::V2) {
25444 __tmp.put_u8(self.id);
25445 __tmp.put_i16_le(self.temperature);
25446 let len = __tmp.len();
25447 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25448 } else {
25449 __tmp.len()
25450 }
25451 }
25452}
25453#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25454#[doc = ""]
25455#[doc = "ID: 28"]
25456#[derive(Debug, Clone, PartialEq)]
25457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25459#[cfg_attr(feature = "ts", derive(TS))]
25460#[cfg_attr(feature = "ts", ts(export))]
25461pub struct RAW_PRESSURE_DATA {
25462 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25463 pub time_usec: u64,
25464 #[doc = "Absolute pressure (raw)"]
25465 pub press_abs: i16,
25466 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25467 pub press_diff1: i16,
25468 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25469 pub press_diff2: i16,
25470 #[doc = "Raw Temperature measurement (raw)"]
25471 pub temperature: i16,
25472}
25473impl RAW_PRESSURE_DATA {
25474 pub const ENCODED_LEN: usize = 16usize;
25475 pub const DEFAULT: Self = Self {
25476 time_usec: 0_u64,
25477 press_abs: 0_i16,
25478 press_diff1: 0_i16,
25479 press_diff2: 0_i16,
25480 temperature: 0_i16,
25481 };
25482 #[cfg(feature = "arbitrary")]
25483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25484 use arbitrary::{Arbitrary, Unstructured};
25485 let mut buf = [0u8; 1024];
25486 rng.fill_bytes(&mut buf);
25487 let mut unstructured = Unstructured::new(&buf);
25488 Self::arbitrary(&mut unstructured).unwrap_or_default()
25489 }
25490}
25491impl Default for RAW_PRESSURE_DATA {
25492 fn default() -> Self {
25493 Self::DEFAULT.clone()
25494 }
25495}
25496impl MessageData for RAW_PRESSURE_DATA {
25497 type Message = MavMessage;
25498 const ID: u32 = 28u32;
25499 const NAME: &'static str = "RAW_PRESSURE";
25500 const EXTRA_CRC: u8 = 67u8;
25501 const ENCODED_LEN: usize = 16usize;
25502 fn deser(
25503 _version: MavlinkVersion,
25504 __input: &[u8],
25505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25506 let avail_len = __input.len();
25507 let mut payload_buf = [0; Self::ENCODED_LEN];
25508 let mut buf = if avail_len < Self::ENCODED_LEN {
25509 payload_buf[0..avail_len].copy_from_slice(__input);
25510 Bytes::new(&payload_buf)
25511 } else {
25512 Bytes::new(__input)
25513 };
25514 let mut __struct = Self::default();
25515 __struct.time_usec = buf.get_u64_le();
25516 __struct.press_abs = buf.get_i16_le();
25517 __struct.press_diff1 = buf.get_i16_le();
25518 __struct.press_diff2 = buf.get_i16_le();
25519 __struct.temperature = buf.get_i16_le();
25520 Ok(__struct)
25521 }
25522 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25523 let mut __tmp = BytesMut::new(bytes);
25524 #[allow(clippy::absurd_extreme_comparisons)]
25525 #[allow(unused_comparisons)]
25526 if __tmp.remaining() < Self::ENCODED_LEN {
25527 panic!(
25528 "buffer is too small (need {} bytes, but got {})",
25529 Self::ENCODED_LEN,
25530 __tmp.remaining(),
25531 )
25532 }
25533 __tmp.put_u64_le(self.time_usec);
25534 __tmp.put_i16_le(self.press_abs);
25535 __tmp.put_i16_le(self.press_diff1);
25536 __tmp.put_i16_le(self.press_diff2);
25537 __tmp.put_i16_le(self.temperature);
25538 if matches!(version, MavlinkVersion::V2) {
25539 let len = __tmp.len();
25540 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25541 } else {
25542 __tmp.len()
25543 }
25544 }
25545}
25546#[doc = "RPM sensor data message."]
25547#[doc = ""]
25548#[doc = "ID: 339"]
25549#[derive(Debug, Clone, PartialEq)]
25550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25552#[cfg_attr(feature = "ts", derive(TS))]
25553#[cfg_attr(feature = "ts", ts(export))]
25554pub struct RAW_RPM_DATA {
25555 #[doc = "Indicated rate"]
25556 pub frequency: f32,
25557 #[doc = "Index of this RPM sensor (0-indexed)"]
25558 pub index: u8,
25559}
25560impl RAW_RPM_DATA {
25561 pub const ENCODED_LEN: usize = 5usize;
25562 pub const DEFAULT: Self = Self {
25563 frequency: 0.0_f32,
25564 index: 0_u8,
25565 };
25566 #[cfg(feature = "arbitrary")]
25567 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25568 use arbitrary::{Arbitrary, Unstructured};
25569 let mut buf = [0u8; 1024];
25570 rng.fill_bytes(&mut buf);
25571 let mut unstructured = Unstructured::new(&buf);
25572 Self::arbitrary(&mut unstructured).unwrap_or_default()
25573 }
25574}
25575impl Default for RAW_RPM_DATA {
25576 fn default() -> Self {
25577 Self::DEFAULT.clone()
25578 }
25579}
25580impl MessageData for RAW_RPM_DATA {
25581 type Message = MavMessage;
25582 const ID: u32 = 339u32;
25583 const NAME: &'static str = "RAW_RPM";
25584 const EXTRA_CRC: u8 = 199u8;
25585 const ENCODED_LEN: usize = 5usize;
25586 fn deser(
25587 _version: MavlinkVersion,
25588 __input: &[u8],
25589 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25590 let avail_len = __input.len();
25591 let mut payload_buf = [0; Self::ENCODED_LEN];
25592 let mut buf = if avail_len < Self::ENCODED_LEN {
25593 payload_buf[0..avail_len].copy_from_slice(__input);
25594 Bytes::new(&payload_buf)
25595 } else {
25596 Bytes::new(__input)
25597 };
25598 let mut __struct = Self::default();
25599 __struct.frequency = buf.get_f32_le();
25600 __struct.index = buf.get_u8();
25601 Ok(__struct)
25602 }
25603 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25604 let mut __tmp = BytesMut::new(bytes);
25605 #[allow(clippy::absurd_extreme_comparisons)]
25606 #[allow(unused_comparisons)]
25607 if __tmp.remaining() < Self::ENCODED_LEN {
25608 panic!(
25609 "buffer is too small (need {} bytes, but got {})",
25610 Self::ENCODED_LEN,
25611 __tmp.remaining(),
25612 )
25613 }
25614 __tmp.put_f32_le(self.frequency);
25615 __tmp.put_u8(self.index);
25616 if matches!(version, MavlinkVersion::V2) {
25617 let len = __tmp.len();
25618 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25619 } else {
25620 __tmp.len()
25621 }
25622 }
25623}
25624#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25625#[doc = ""]
25626#[doc = "ID: 65"]
25627#[derive(Debug, Clone, PartialEq)]
25628#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25629#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25630#[cfg_attr(feature = "ts", derive(TS))]
25631#[cfg_attr(feature = "ts", ts(export))]
25632pub struct RC_CHANNELS_DATA {
25633 #[doc = "Timestamp (time since system boot)."]
25634 pub time_boot_ms: u32,
25635 #[doc = "RC channel 1 value."]
25636 pub chan1_raw: u16,
25637 #[doc = "RC channel 2 value."]
25638 pub chan2_raw: u16,
25639 #[doc = "RC channel 3 value."]
25640 pub chan3_raw: u16,
25641 #[doc = "RC channel 4 value."]
25642 pub chan4_raw: u16,
25643 #[doc = "RC channel 5 value."]
25644 pub chan5_raw: u16,
25645 #[doc = "RC channel 6 value."]
25646 pub chan6_raw: u16,
25647 #[doc = "RC channel 7 value."]
25648 pub chan7_raw: u16,
25649 #[doc = "RC channel 8 value."]
25650 pub chan8_raw: u16,
25651 #[doc = "RC channel 9 value."]
25652 pub chan9_raw: u16,
25653 #[doc = "RC channel 10 value."]
25654 pub chan10_raw: u16,
25655 #[doc = "RC channel 11 value."]
25656 pub chan11_raw: u16,
25657 #[doc = "RC channel 12 value."]
25658 pub chan12_raw: u16,
25659 #[doc = "RC channel 13 value."]
25660 pub chan13_raw: u16,
25661 #[doc = "RC channel 14 value."]
25662 pub chan14_raw: u16,
25663 #[doc = "RC channel 15 value."]
25664 pub chan15_raw: u16,
25665 #[doc = "RC channel 16 value."]
25666 pub chan16_raw: u16,
25667 #[doc = "RC channel 17 value."]
25668 pub chan17_raw: u16,
25669 #[doc = "RC channel 18 value."]
25670 pub chan18_raw: u16,
25671 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25672 pub chancount: u8,
25673 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25674 pub rssi: u8,
25675}
25676impl RC_CHANNELS_DATA {
25677 pub const ENCODED_LEN: usize = 42usize;
25678 pub const DEFAULT: Self = Self {
25679 time_boot_ms: 0_u32,
25680 chan1_raw: 0_u16,
25681 chan2_raw: 0_u16,
25682 chan3_raw: 0_u16,
25683 chan4_raw: 0_u16,
25684 chan5_raw: 0_u16,
25685 chan6_raw: 0_u16,
25686 chan7_raw: 0_u16,
25687 chan8_raw: 0_u16,
25688 chan9_raw: 0_u16,
25689 chan10_raw: 0_u16,
25690 chan11_raw: 0_u16,
25691 chan12_raw: 0_u16,
25692 chan13_raw: 0_u16,
25693 chan14_raw: 0_u16,
25694 chan15_raw: 0_u16,
25695 chan16_raw: 0_u16,
25696 chan17_raw: 0_u16,
25697 chan18_raw: 0_u16,
25698 chancount: 0_u8,
25699 rssi: 0_u8,
25700 };
25701 #[cfg(feature = "arbitrary")]
25702 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25703 use arbitrary::{Arbitrary, Unstructured};
25704 let mut buf = [0u8; 1024];
25705 rng.fill_bytes(&mut buf);
25706 let mut unstructured = Unstructured::new(&buf);
25707 Self::arbitrary(&mut unstructured).unwrap_or_default()
25708 }
25709}
25710impl Default for RC_CHANNELS_DATA {
25711 fn default() -> Self {
25712 Self::DEFAULT.clone()
25713 }
25714}
25715impl MessageData for RC_CHANNELS_DATA {
25716 type Message = MavMessage;
25717 const ID: u32 = 65u32;
25718 const NAME: &'static str = "RC_CHANNELS";
25719 const EXTRA_CRC: u8 = 118u8;
25720 const ENCODED_LEN: usize = 42usize;
25721 fn deser(
25722 _version: MavlinkVersion,
25723 __input: &[u8],
25724 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25725 let avail_len = __input.len();
25726 let mut payload_buf = [0; Self::ENCODED_LEN];
25727 let mut buf = if avail_len < Self::ENCODED_LEN {
25728 payload_buf[0..avail_len].copy_from_slice(__input);
25729 Bytes::new(&payload_buf)
25730 } else {
25731 Bytes::new(__input)
25732 };
25733 let mut __struct = Self::default();
25734 __struct.time_boot_ms = buf.get_u32_le();
25735 __struct.chan1_raw = buf.get_u16_le();
25736 __struct.chan2_raw = buf.get_u16_le();
25737 __struct.chan3_raw = buf.get_u16_le();
25738 __struct.chan4_raw = buf.get_u16_le();
25739 __struct.chan5_raw = buf.get_u16_le();
25740 __struct.chan6_raw = buf.get_u16_le();
25741 __struct.chan7_raw = buf.get_u16_le();
25742 __struct.chan8_raw = buf.get_u16_le();
25743 __struct.chan9_raw = buf.get_u16_le();
25744 __struct.chan10_raw = buf.get_u16_le();
25745 __struct.chan11_raw = buf.get_u16_le();
25746 __struct.chan12_raw = buf.get_u16_le();
25747 __struct.chan13_raw = buf.get_u16_le();
25748 __struct.chan14_raw = buf.get_u16_le();
25749 __struct.chan15_raw = buf.get_u16_le();
25750 __struct.chan16_raw = buf.get_u16_le();
25751 __struct.chan17_raw = buf.get_u16_le();
25752 __struct.chan18_raw = buf.get_u16_le();
25753 __struct.chancount = buf.get_u8();
25754 __struct.rssi = buf.get_u8();
25755 Ok(__struct)
25756 }
25757 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25758 let mut __tmp = BytesMut::new(bytes);
25759 #[allow(clippy::absurd_extreme_comparisons)]
25760 #[allow(unused_comparisons)]
25761 if __tmp.remaining() < Self::ENCODED_LEN {
25762 panic!(
25763 "buffer is too small (need {} bytes, but got {})",
25764 Self::ENCODED_LEN,
25765 __tmp.remaining(),
25766 )
25767 }
25768 __tmp.put_u32_le(self.time_boot_ms);
25769 __tmp.put_u16_le(self.chan1_raw);
25770 __tmp.put_u16_le(self.chan2_raw);
25771 __tmp.put_u16_le(self.chan3_raw);
25772 __tmp.put_u16_le(self.chan4_raw);
25773 __tmp.put_u16_le(self.chan5_raw);
25774 __tmp.put_u16_le(self.chan6_raw);
25775 __tmp.put_u16_le(self.chan7_raw);
25776 __tmp.put_u16_le(self.chan8_raw);
25777 __tmp.put_u16_le(self.chan9_raw);
25778 __tmp.put_u16_le(self.chan10_raw);
25779 __tmp.put_u16_le(self.chan11_raw);
25780 __tmp.put_u16_le(self.chan12_raw);
25781 __tmp.put_u16_le(self.chan13_raw);
25782 __tmp.put_u16_le(self.chan14_raw);
25783 __tmp.put_u16_le(self.chan15_raw);
25784 __tmp.put_u16_le(self.chan16_raw);
25785 __tmp.put_u16_le(self.chan17_raw);
25786 __tmp.put_u16_le(self.chan18_raw);
25787 __tmp.put_u8(self.chancount);
25788 __tmp.put_u8(self.rssi);
25789 if matches!(version, MavlinkVersion::V2) {
25790 let len = __tmp.len();
25791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25792 } else {
25793 __tmp.len()
25794 }
25795 }
25796}
25797#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25798#[doc = ""]
25799#[doc = "ID: 70"]
25800#[derive(Debug, Clone, PartialEq)]
25801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25803#[cfg_attr(feature = "ts", derive(TS))]
25804#[cfg_attr(feature = "ts", ts(export))]
25805pub struct RC_CHANNELS_OVERRIDE_DATA {
25806 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25807 pub chan1_raw: u16,
25808 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25809 pub chan2_raw: u16,
25810 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25811 pub chan3_raw: u16,
25812 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25813 pub chan4_raw: u16,
25814 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25815 pub chan5_raw: u16,
25816 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25817 pub chan6_raw: u16,
25818 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25819 pub chan7_raw: u16,
25820 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25821 pub chan8_raw: u16,
25822 #[doc = "System ID"]
25823 pub target_system: u8,
25824 #[doc = "Component ID"]
25825 pub target_component: u8,
25826 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25827 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25828 pub chan9_raw: u16,
25829 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25830 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25831 pub chan10_raw: u16,
25832 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25833 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25834 pub chan11_raw: u16,
25835 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25836 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25837 pub chan12_raw: u16,
25838 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25839 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25840 pub chan13_raw: u16,
25841 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25842 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25843 pub chan14_raw: u16,
25844 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25845 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25846 pub chan15_raw: u16,
25847 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25848 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25849 pub chan16_raw: u16,
25850 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25851 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25852 pub chan17_raw: u16,
25853 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25854 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25855 pub chan18_raw: u16,
25856}
25857impl RC_CHANNELS_OVERRIDE_DATA {
25858 pub const ENCODED_LEN: usize = 38usize;
25859 pub const DEFAULT: Self = Self {
25860 chan1_raw: 0_u16,
25861 chan2_raw: 0_u16,
25862 chan3_raw: 0_u16,
25863 chan4_raw: 0_u16,
25864 chan5_raw: 0_u16,
25865 chan6_raw: 0_u16,
25866 chan7_raw: 0_u16,
25867 chan8_raw: 0_u16,
25868 target_system: 0_u8,
25869 target_component: 0_u8,
25870 chan9_raw: 0_u16,
25871 chan10_raw: 0_u16,
25872 chan11_raw: 0_u16,
25873 chan12_raw: 0_u16,
25874 chan13_raw: 0_u16,
25875 chan14_raw: 0_u16,
25876 chan15_raw: 0_u16,
25877 chan16_raw: 0_u16,
25878 chan17_raw: 0_u16,
25879 chan18_raw: 0_u16,
25880 };
25881 #[cfg(feature = "arbitrary")]
25882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25883 use arbitrary::{Arbitrary, Unstructured};
25884 let mut buf = [0u8; 1024];
25885 rng.fill_bytes(&mut buf);
25886 let mut unstructured = Unstructured::new(&buf);
25887 Self::arbitrary(&mut unstructured).unwrap_or_default()
25888 }
25889}
25890impl Default for RC_CHANNELS_OVERRIDE_DATA {
25891 fn default() -> Self {
25892 Self::DEFAULT.clone()
25893 }
25894}
25895impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25896 type Message = MavMessage;
25897 const ID: u32 = 70u32;
25898 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25899 const EXTRA_CRC: u8 = 124u8;
25900 const ENCODED_LEN: usize = 38usize;
25901 fn deser(
25902 _version: MavlinkVersion,
25903 __input: &[u8],
25904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25905 let avail_len = __input.len();
25906 let mut payload_buf = [0; Self::ENCODED_LEN];
25907 let mut buf = if avail_len < Self::ENCODED_LEN {
25908 payload_buf[0..avail_len].copy_from_slice(__input);
25909 Bytes::new(&payload_buf)
25910 } else {
25911 Bytes::new(__input)
25912 };
25913 let mut __struct = Self::default();
25914 __struct.chan1_raw = buf.get_u16_le();
25915 __struct.chan2_raw = buf.get_u16_le();
25916 __struct.chan3_raw = buf.get_u16_le();
25917 __struct.chan4_raw = buf.get_u16_le();
25918 __struct.chan5_raw = buf.get_u16_le();
25919 __struct.chan6_raw = buf.get_u16_le();
25920 __struct.chan7_raw = buf.get_u16_le();
25921 __struct.chan8_raw = buf.get_u16_le();
25922 __struct.target_system = buf.get_u8();
25923 __struct.target_component = buf.get_u8();
25924 __struct.chan9_raw = buf.get_u16_le();
25925 __struct.chan10_raw = buf.get_u16_le();
25926 __struct.chan11_raw = buf.get_u16_le();
25927 __struct.chan12_raw = buf.get_u16_le();
25928 __struct.chan13_raw = buf.get_u16_le();
25929 __struct.chan14_raw = buf.get_u16_le();
25930 __struct.chan15_raw = buf.get_u16_le();
25931 __struct.chan16_raw = buf.get_u16_le();
25932 __struct.chan17_raw = buf.get_u16_le();
25933 __struct.chan18_raw = buf.get_u16_le();
25934 Ok(__struct)
25935 }
25936 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25937 let mut __tmp = BytesMut::new(bytes);
25938 #[allow(clippy::absurd_extreme_comparisons)]
25939 #[allow(unused_comparisons)]
25940 if __tmp.remaining() < Self::ENCODED_LEN {
25941 panic!(
25942 "buffer is too small (need {} bytes, but got {})",
25943 Self::ENCODED_LEN,
25944 __tmp.remaining(),
25945 )
25946 }
25947 __tmp.put_u16_le(self.chan1_raw);
25948 __tmp.put_u16_le(self.chan2_raw);
25949 __tmp.put_u16_le(self.chan3_raw);
25950 __tmp.put_u16_le(self.chan4_raw);
25951 __tmp.put_u16_le(self.chan5_raw);
25952 __tmp.put_u16_le(self.chan6_raw);
25953 __tmp.put_u16_le(self.chan7_raw);
25954 __tmp.put_u16_le(self.chan8_raw);
25955 __tmp.put_u8(self.target_system);
25956 __tmp.put_u8(self.target_component);
25957 if matches!(version, MavlinkVersion::V2) {
25958 __tmp.put_u16_le(self.chan9_raw);
25959 __tmp.put_u16_le(self.chan10_raw);
25960 __tmp.put_u16_le(self.chan11_raw);
25961 __tmp.put_u16_le(self.chan12_raw);
25962 __tmp.put_u16_le(self.chan13_raw);
25963 __tmp.put_u16_le(self.chan14_raw);
25964 __tmp.put_u16_le(self.chan15_raw);
25965 __tmp.put_u16_le(self.chan16_raw);
25966 __tmp.put_u16_le(self.chan17_raw);
25967 __tmp.put_u16_le(self.chan18_raw);
25968 let len = __tmp.len();
25969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25970 } else {
25971 __tmp.len()
25972 }
25973 }
25974}
25975#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25976#[doc = ""]
25977#[doc = "ID: 35"]
25978#[derive(Debug, Clone, PartialEq)]
25979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25980#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25981#[cfg_attr(feature = "ts", derive(TS))]
25982#[cfg_attr(feature = "ts", ts(export))]
25983pub struct RC_CHANNELS_RAW_DATA {
25984 #[doc = "Timestamp (time since system boot)."]
25985 pub time_boot_ms: u32,
25986 #[doc = "RC channel 1 value."]
25987 pub chan1_raw: u16,
25988 #[doc = "RC channel 2 value."]
25989 pub chan2_raw: u16,
25990 #[doc = "RC channel 3 value."]
25991 pub chan3_raw: u16,
25992 #[doc = "RC channel 4 value."]
25993 pub chan4_raw: u16,
25994 #[doc = "RC channel 5 value."]
25995 pub chan5_raw: u16,
25996 #[doc = "RC channel 6 value."]
25997 pub chan6_raw: u16,
25998 #[doc = "RC channel 7 value."]
25999 pub chan7_raw: u16,
26000 #[doc = "RC channel 8 value."]
26001 pub chan8_raw: u16,
26002 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26003 pub port: u8,
26004 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26005 pub rssi: u8,
26006}
26007impl RC_CHANNELS_RAW_DATA {
26008 pub const ENCODED_LEN: usize = 22usize;
26009 pub const DEFAULT: Self = Self {
26010 time_boot_ms: 0_u32,
26011 chan1_raw: 0_u16,
26012 chan2_raw: 0_u16,
26013 chan3_raw: 0_u16,
26014 chan4_raw: 0_u16,
26015 chan5_raw: 0_u16,
26016 chan6_raw: 0_u16,
26017 chan7_raw: 0_u16,
26018 chan8_raw: 0_u16,
26019 port: 0_u8,
26020 rssi: 0_u8,
26021 };
26022 #[cfg(feature = "arbitrary")]
26023 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26024 use arbitrary::{Arbitrary, Unstructured};
26025 let mut buf = [0u8; 1024];
26026 rng.fill_bytes(&mut buf);
26027 let mut unstructured = Unstructured::new(&buf);
26028 Self::arbitrary(&mut unstructured).unwrap_or_default()
26029 }
26030}
26031impl Default for RC_CHANNELS_RAW_DATA {
26032 fn default() -> Self {
26033 Self::DEFAULT.clone()
26034 }
26035}
26036impl MessageData for RC_CHANNELS_RAW_DATA {
26037 type Message = MavMessage;
26038 const ID: u32 = 35u32;
26039 const NAME: &'static str = "RC_CHANNELS_RAW";
26040 const EXTRA_CRC: u8 = 244u8;
26041 const ENCODED_LEN: usize = 22usize;
26042 fn deser(
26043 _version: MavlinkVersion,
26044 __input: &[u8],
26045 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26046 let avail_len = __input.len();
26047 let mut payload_buf = [0; Self::ENCODED_LEN];
26048 let mut buf = if avail_len < Self::ENCODED_LEN {
26049 payload_buf[0..avail_len].copy_from_slice(__input);
26050 Bytes::new(&payload_buf)
26051 } else {
26052 Bytes::new(__input)
26053 };
26054 let mut __struct = Self::default();
26055 __struct.time_boot_ms = buf.get_u32_le();
26056 __struct.chan1_raw = buf.get_u16_le();
26057 __struct.chan2_raw = buf.get_u16_le();
26058 __struct.chan3_raw = buf.get_u16_le();
26059 __struct.chan4_raw = buf.get_u16_le();
26060 __struct.chan5_raw = buf.get_u16_le();
26061 __struct.chan6_raw = buf.get_u16_le();
26062 __struct.chan7_raw = buf.get_u16_le();
26063 __struct.chan8_raw = buf.get_u16_le();
26064 __struct.port = buf.get_u8();
26065 __struct.rssi = buf.get_u8();
26066 Ok(__struct)
26067 }
26068 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26069 let mut __tmp = BytesMut::new(bytes);
26070 #[allow(clippy::absurd_extreme_comparisons)]
26071 #[allow(unused_comparisons)]
26072 if __tmp.remaining() < Self::ENCODED_LEN {
26073 panic!(
26074 "buffer is too small (need {} bytes, but got {})",
26075 Self::ENCODED_LEN,
26076 __tmp.remaining(),
26077 )
26078 }
26079 __tmp.put_u32_le(self.time_boot_ms);
26080 __tmp.put_u16_le(self.chan1_raw);
26081 __tmp.put_u16_le(self.chan2_raw);
26082 __tmp.put_u16_le(self.chan3_raw);
26083 __tmp.put_u16_le(self.chan4_raw);
26084 __tmp.put_u16_le(self.chan5_raw);
26085 __tmp.put_u16_le(self.chan6_raw);
26086 __tmp.put_u16_le(self.chan7_raw);
26087 __tmp.put_u16_le(self.chan8_raw);
26088 __tmp.put_u8(self.port);
26089 __tmp.put_u8(self.rssi);
26090 if matches!(version, MavlinkVersion::V2) {
26091 let len = __tmp.len();
26092 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26093 } else {
26094 __tmp.len()
26095 }
26096 }
26097}
26098#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26099#[doc = ""]
26100#[doc = "ID: 34"]
26101#[derive(Debug, Clone, PartialEq)]
26102#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26103#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26104#[cfg_attr(feature = "ts", derive(TS))]
26105#[cfg_attr(feature = "ts", ts(export))]
26106pub struct RC_CHANNELS_SCALED_DATA {
26107 #[doc = "Timestamp (time since system boot)."]
26108 pub time_boot_ms: u32,
26109 #[doc = "RC channel 1 value scaled."]
26110 pub chan1_scaled: i16,
26111 #[doc = "RC channel 2 value scaled."]
26112 pub chan2_scaled: i16,
26113 #[doc = "RC channel 3 value scaled."]
26114 pub chan3_scaled: i16,
26115 #[doc = "RC channel 4 value scaled."]
26116 pub chan4_scaled: i16,
26117 #[doc = "RC channel 5 value scaled."]
26118 pub chan5_scaled: i16,
26119 #[doc = "RC channel 6 value scaled."]
26120 pub chan6_scaled: i16,
26121 #[doc = "RC channel 7 value scaled."]
26122 pub chan7_scaled: i16,
26123 #[doc = "RC channel 8 value scaled."]
26124 pub chan8_scaled: i16,
26125 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26126 pub port: u8,
26127 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26128 pub rssi: u8,
26129}
26130impl RC_CHANNELS_SCALED_DATA {
26131 pub const ENCODED_LEN: usize = 22usize;
26132 pub const DEFAULT: Self = Self {
26133 time_boot_ms: 0_u32,
26134 chan1_scaled: 0_i16,
26135 chan2_scaled: 0_i16,
26136 chan3_scaled: 0_i16,
26137 chan4_scaled: 0_i16,
26138 chan5_scaled: 0_i16,
26139 chan6_scaled: 0_i16,
26140 chan7_scaled: 0_i16,
26141 chan8_scaled: 0_i16,
26142 port: 0_u8,
26143 rssi: 0_u8,
26144 };
26145 #[cfg(feature = "arbitrary")]
26146 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26147 use arbitrary::{Arbitrary, Unstructured};
26148 let mut buf = [0u8; 1024];
26149 rng.fill_bytes(&mut buf);
26150 let mut unstructured = Unstructured::new(&buf);
26151 Self::arbitrary(&mut unstructured).unwrap_or_default()
26152 }
26153}
26154impl Default for RC_CHANNELS_SCALED_DATA {
26155 fn default() -> Self {
26156 Self::DEFAULT.clone()
26157 }
26158}
26159impl MessageData for RC_CHANNELS_SCALED_DATA {
26160 type Message = MavMessage;
26161 const ID: u32 = 34u32;
26162 const NAME: &'static str = "RC_CHANNELS_SCALED";
26163 const EXTRA_CRC: u8 = 237u8;
26164 const ENCODED_LEN: usize = 22usize;
26165 fn deser(
26166 _version: MavlinkVersion,
26167 __input: &[u8],
26168 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26169 let avail_len = __input.len();
26170 let mut payload_buf = [0; Self::ENCODED_LEN];
26171 let mut buf = if avail_len < Self::ENCODED_LEN {
26172 payload_buf[0..avail_len].copy_from_slice(__input);
26173 Bytes::new(&payload_buf)
26174 } else {
26175 Bytes::new(__input)
26176 };
26177 let mut __struct = Self::default();
26178 __struct.time_boot_ms = buf.get_u32_le();
26179 __struct.chan1_scaled = buf.get_i16_le();
26180 __struct.chan2_scaled = buf.get_i16_le();
26181 __struct.chan3_scaled = buf.get_i16_le();
26182 __struct.chan4_scaled = buf.get_i16_le();
26183 __struct.chan5_scaled = buf.get_i16_le();
26184 __struct.chan6_scaled = buf.get_i16_le();
26185 __struct.chan7_scaled = buf.get_i16_le();
26186 __struct.chan8_scaled = buf.get_i16_le();
26187 __struct.port = buf.get_u8();
26188 __struct.rssi = buf.get_u8();
26189 Ok(__struct)
26190 }
26191 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26192 let mut __tmp = BytesMut::new(bytes);
26193 #[allow(clippy::absurd_extreme_comparisons)]
26194 #[allow(unused_comparisons)]
26195 if __tmp.remaining() < Self::ENCODED_LEN {
26196 panic!(
26197 "buffer is too small (need {} bytes, but got {})",
26198 Self::ENCODED_LEN,
26199 __tmp.remaining(),
26200 )
26201 }
26202 __tmp.put_u32_le(self.time_boot_ms);
26203 __tmp.put_i16_le(self.chan1_scaled);
26204 __tmp.put_i16_le(self.chan2_scaled);
26205 __tmp.put_i16_le(self.chan3_scaled);
26206 __tmp.put_i16_le(self.chan4_scaled);
26207 __tmp.put_i16_le(self.chan5_scaled);
26208 __tmp.put_i16_le(self.chan6_scaled);
26209 __tmp.put_i16_le(self.chan7_scaled);
26210 __tmp.put_i16_le(self.chan8_scaled);
26211 __tmp.put_u8(self.port);
26212 __tmp.put_u8(self.rssi);
26213 if matches!(version, MavlinkVersion::V2) {
26214 let len = __tmp.len();
26215 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26216 } else {
26217 __tmp.len()
26218 }
26219 }
26220}
26221#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26222#[doc = "Request a data stream."]
26223#[doc = ""]
26224#[doc = "ID: 66"]
26225#[derive(Debug, Clone, PartialEq)]
26226#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26228#[cfg_attr(feature = "ts", derive(TS))]
26229#[cfg_attr(feature = "ts", ts(export))]
26230pub struct REQUEST_DATA_STREAM_DATA {
26231 #[doc = "The requested message rate"]
26232 pub req_message_rate: u16,
26233 #[doc = "The target requested to send the message stream."]
26234 pub target_system: u8,
26235 #[doc = "The target requested to send the message stream."]
26236 pub target_component: u8,
26237 #[doc = "The ID of the requested data stream"]
26238 pub req_stream_id: u8,
26239 #[doc = "1 to start sending, 0 to stop sending."]
26240 pub start_stop: u8,
26241}
26242impl REQUEST_DATA_STREAM_DATA {
26243 pub const ENCODED_LEN: usize = 6usize;
26244 pub const DEFAULT: Self = Self {
26245 req_message_rate: 0_u16,
26246 target_system: 0_u8,
26247 target_component: 0_u8,
26248 req_stream_id: 0_u8,
26249 start_stop: 0_u8,
26250 };
26251 #[cfg(feature = "arbitrary")]
26252 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26253 use arbitrary::{Arbitrary, Unstructured};
26254 let mut buf = [0u8; 1024];
26255 rng.fill_bytes(&mut buf);
26256 let mut unstructured = Unstructured::new(&buf);
26257 Self::arbitrary(&mut unstructured).unwrap_or_default()
26258 }
26259}
26260impl Default for REQUEST_DATA_STREAM_DATA {
26261 fn default() -> Self {
26262 Self::DEFAULT.clone()
26263 }
26264}
26265impl MessageData for REQUEST_DATA_STREAM_DATA {
26266 type Message = MavMessage;
26267 const ID: u32 = 66u32;
26268 const NAME: &'static str = "REQUEST_DATA_STREAM";
26269 const EXTRA_CRC: u8 = 148u8;
26270 const ENCODED_LEN: usize = 6usize;
26271 fn deser(
26272 _version: MavlinkVersion,
26273 __input: &[u8],
26274 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26275 let avail_len = __input.len();
26276 let mut payload_buf = [0; Self::ENCODED_LEN];
26277 let mut buf = if avail_len < Self::ENCODED_LEN {
26278 payload_buf[0..avail_len].copy_from_slice(__input);
26279 Bytes::new(&payload_buf)
26280 } else {
26281 Bytes::new(__input)
26282 };
26283 let mut __struct = Self::default();
26284 __struct.req_message_rate = buf.get_u16_le();
26285 __struct.target_system = buf.get_u8();
26286 __struct.target_component = buf.get_u8();
26287 __struct.req_stream_id = buf.get_u8();
26288 __struct.start_stop = buf.get_u8();
26289 Ok(__struct)
26290 }
26291 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26292 let mut __tmp = BytesMut::new(bytes);
26293 #[allow(clippy::absurd_extreme_comparisons)]
26294 #[allow(unused_comparisons)]
26295 if __tmp.remaining() < Self::ENCODED_LEN {
26296 panic!(
26297 "buffer is too small (need {} bytes, but got {})",
26298 Self::ENCODED_LEN,
26299 __tmp.remaining(),
26300 )
26301 }
26302 __tmp.put_u16_le(self.req_message_rate);
26303 __tmp.put_u8(self.target_system);
26304 __tmp.put_u8(self.target_component);
26305 __tmp.put_u8(self.req_stream_id);
26306 __tmp.put_u8(self.start_stop);
26307 if matches!(version, MavlinkVersion::V2) {
26308 let len = __tmp.len();
26309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26310 } else {
26311 __tmp.len()
26312 }
26313 }
26314}
26315#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26316#[doc = ""]
26317#[doc = "ID: 412"]
26318#[derive(Debug, Clone, PartialEq)]
26319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26321#[cfg_attr(feature = "ts", derive(TS))]
26322#[cfg_attr(feature = "ts", ts(export))]
26323pub struct REQUEST_EVENT_DATA {
26324 #[doc = "First sequence number of the requested event."]
26325 pub first_sequence: u16,
26326 #[doc = "Last sequence number of the requested event."]
26327 pub last_sequence: u16,
26328 #[doc = "System ID"]
26329 pub target_system: u8,
26330 #[doc = "Component ID"]
26331 pub target_component: u8,
26332}
26333impl REQUEST_EVENT_DATA {
26334 pub const ENCODED_LEN: usize = 6usize;
26335 pub const DEFAULT: Self = Self {
26336 first_sequence: 0_u16,
26337 last_sequence: 0_u16,
26338 target_system: 0_u8,
26339 target_component: 0_u8,
26340 };
26341 #[cfg(feature = "arbitrary")]
26342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26343 use arbitrary::{Arbitrary, Unstructured};
26344 let mut buf = [0u8; 1024];
26345 rng.fill_bytes(&mut buf);
26346 let mut unstructured = Unstructured::new(&buf);
26347 Self::arbitrary(&mut unstructured).unwrap_or_default()
26348 }
26349}
26350impl Default for REQUEST_EVENT_DATA {
26351 fn default() -> Self {
26352 Self::DEFAULT.clone()
26353 }
26354}
26355impl MessageData for REQUEST_EVENT_DATA {
26356 type Message = MavMessage;
26357 const ID: u32 = 412u32;
26358 const NAME: &'static str = "REQUEST_EVENT";
26359 const EXTRA_CRC: u8 = 33u8;
26360 const ENCODED_LEN: usize = 6usize;
26361 fn deser(
26362 _version: MavlinkVersion,
26363 __input: &[u8],
26364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26365 let avail_len = __input.len();
26366 let mut payload_buf = [0; Self::ENCODED_LEN];
26367 let mut buf = if avail_len < Self::ENCODED_LEN {
26368 payload_buf[0..avail_len].copy_from_slice(__input);
26369 Bytes::new(&payload_buf)
26370 } else {
26371 Bytes::new(__input)
26372 };
26373 let mut __struct = Self::default();
26374 __struct.first_sequence = buf.get_u16_le();
26375 __struct.last_sequence = buf.get_u16_le();
26376 __struct.target_system = buf.get_u8();
26377 __struct.target_component = buf.get_u8();
26378 Ok(__struct)
26379 }
26380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26381 let mut __tmp = BytesMut::new(bytes);
26382 #[allow(clippy::absurd_extreme_comparisons)]
26383 #[allow(unused_comparisons)]
26384 if __tmp.remaining() < Self::ENCODED_LEN {
26385 panic!(
26386 "buffer is too small (need {} bytes, but got {})",
26387 Self::ENCODED_LEN,
26388 __tmp.remaining(),
26389 )
26390 }
26391 __tmp.put_u16_le(self.first_sequence);
26392 __tmp.put_u16_le(self.last_sequence);
26393 __tmp.put_u8(self.target_system);
26394 __tmp.put_u8(self.target_component);
26395 if matches!(version, MavlinkVersion::V2) {
26396 let len = __tmp.len();
26397 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26398 } else {
26399 __tmp.len()
26400 }
26401 }
26402}
26403#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26404#[doc = ""]
26405#[doc = "ID: 142"]
26406#[derive(Debug, Clone, PartialEq)]
26407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26409#[cfg_attr(feature = "ts", derive(TS))]
26410#[cfg_attr(feature = "ts", ts(export))]
26411pub struct RESOURCE_REQUEST_DATA {
26412 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26413 pub request_id: u8,
26414 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26415 pub uri_type: u8,
26416 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26417 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26418 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26419 pub uri: [u8; 120],
26420 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26421 pub transfer_type: u8,
26422 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26423 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26424 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26425 pub storage: [u8; 120],
26426}
26427impl RESOURCE_REQUEST_DATA {
26428 pub const ENCODED_LEN: usize = 243usize;
26429 pub const DEFAULT: Self = Self {
26430 request_id: 0_u8,
26431 uri_type: 0_u8,
26432 uri: [0_u8; 120usize],
26433 transfer_type: 0_u8,
26434 storage: [0_u8; 120usize],
26435 };
26436 #[cfg(feature = "arbitrary")]
26437 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26438 use arbitrary::{Arbitrary, Unstructured};
26439 let mut buf = [0u8; 1024];
26440 rng.fill_bytes(&mut buf);
26441 let mut unstructured = Unstructured::new(&buf);
26442 Self::arbitrary(&mut unstructured).unwrap_or_default()
26443 }
26444}
26445impl Default for RESOURCE_REQUEST_DATA {
26446 fn default() -> Self {
26447 Self::DEFAULT.clone()
26448 }
26449}
26450impl MessageData for RESOURCE_REQUEST_DATA {
26451 type Message = MavMessage;
26452 const ID: u32 = 142u32;
26453 const NAME: &'static str = "RESOURCE_REQUEST";
26454 const EXTRA_CRC: u8 = 72u8;
26455 const ENCODED_LEN: usize = 243usize;
26456 fn deser(
26457 _version: MavlinkVersion,
26458 __input: &[u8],
26459 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26460 let avail_len = __input.len();
26461 let mut payload_buf = [0; Self::ENCODED_LEN];
26462 let mut buf = if avail_len < Self::ENCODED_LEN {
26463 payload_buf[0..avail_len].copy_from_slice(__input);
26464 Bytes::new(&payload_buf)
26465 } else {
26466 Bytes::new(__input)
26467 };
26468 let mut __struct = Self::default();
26469 __struct.request_id = buf.get_u8();
26470 __struct.uri_type = buf.get_u8();
26471 for v in &mut __struct.uri {
26472 let val = buf.get_u8();
26473 *v = val;
26474 }
26475 __struct.transfer_type = buf.get_u8();
26476 for v in &mut __struct.storage {
26477 let val = buf.get_u8();
26478 *v = val;
26479 }
26480 Ok(__struct)
26481 }
26482 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26483 let mut __tmp = BytesMut::new(bytes);
26484 #[allow(clippy::absurd_extreme_comparisons)]
26485 #[allow(unused_comparisons)]
26486 if __tmp.remaining() < Self::ENCODED_LEN {
26487 panic!(
26488 "buffer is too small (need {} bytes, but got {})",
26489 Self::ENCODED_LEN,
26490 __tmp.remaining(),
26491 )
26492 }
26493 __tmp.put_u8(self.request_id);
26494 __tmp.put_u8(self.uri_type);
26495 for val in &self.uri {
26496 __tmp.put_u8(*val);
26497 }
26498 __tmp.put_u8(self.transfer_type);
26499 for val in &self.storage {
26500 __tmp.put_u8(*val);
26501 }
26502 if matches!(version, MavlinkVersion::V2) {
26503 let len = __tmp.len();
26504 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26505 } else {
26506 __tmp.len()
26507 }
26508 }
26509}
26510#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26511#[doc = ""]
26512#[doc = "ID: 413"]
26513#[derive(Debug, Clone, PartialEq)]
26514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26515#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26516#[cfg_attr(feature = "ts", derive(TS))]
26517#[cfg_attr(feature = "ts", ts(export))]
26518pub struct RESPONSE_EVENT_ERROR_DATA {
26519 #[doc = "Sequence number."]
26520 pub sequence: u16,
26521 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26522 pub sequence_oldest_available: u16,
26523 #[doc = "System ID"]
26524 pub target_system: u8,
26525 #[doc = "Component ID"]
26526 pub target_component: u8,
26527 #[doc = "Error reason."]
26528 pub reason: MavEventErrorReason,
26529}
26530impl RESPONSE_EVENT_ERROR_DATA {
26531 pub const ENCODED_LEN: usize = 7usize;
26532 pub const DEFAULT: Self = Self {
26533 sequence: 0_u16,
26534 sequence_oldest_available: 0_u16,
26535 target_system: 0_u8,
26536 target_component: 0_u8,
26537 reason: MavEventErrorReason::DEFAULT,
26538 };
26539 #[cfg(feature = "arbitrary")]
26540 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26541 use arbitrary::{Arbitrary, Unstructured};
26542 let mut buf = [0u8; 1024];
26543 rng.fill_bytes(&mut buf);
26544 let mut unstructured = Unstructured::new(&buf);
26545 Self::arbitrary(&mut unstructured).unwrap_or_default()
26546 }
26547}
26548impl Default for RESPONSE_EVENT_ERROR_DATA {
26549 fn default() -> Self {
26550 Self::DEFAULT.clone()
26551 }
26552}
26553impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26554 type Message = MavMessage;
26555 const ID: u32 = 413u32;
26556 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26557 const EXTRA_CRC: u8 = 77u8;
26558 const ENCODED_LEN: usize = 7usize;
26559 fn deser(
26560 _version: MavlinkVersion,
26561 __input: &[u8],
26562 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26563 let avail_len = __input.len();
26564 let mut payload_buf = [0; Self::ENCODED_LEN];
26565 let mut buf = if avail_len < Self::ENCODED_LEN {
26566 payload_buf[0..avail_len].copy_from_slice(__input);
26567 Bytes::new(&payload_buf)
26568 } else {
26569 Bytes::new(__input)
26570 };
26571 let mut __struct = Self::default();
26572 __struct.sequence = buf.get_u16_le();
26573 __struct.sequence_oldest_available = buf.get_u16_le();
26574 __struct.target_system = buf.get_u8();
26575 __struct.target_component = buf.get_u8();
26576 let tmp = buf.get_u8();
26577 __struct.reason =
26578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26579 enum_type: "MavEventErrorReason",
26580 value: tmp as u32,
26581 })?;
26582 Ok(__struct)
26583 }
26584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26585 let mut __tmp = BytesMut::new(bytes);
26586 #[allow(clippy::absurd_extreme_comparisons)]
26587 #[allow(unused_comparisons)]
26588 if __tmp.remaining() < Self::ENCODED_LEN {
26589 panic!(
26590 "buffer is too small (need {} bytes, but got {})",
26591 Self::ENCODED_LEN,
26592 __tmp.remaining(),
26593 )
26594 }
26595 __tmp.put_u16_le(self.sequence);
26596 __tmp.put_u16_le(self.sequence_oldest_available);
26597 __tmp.put_u8(self.target_system);
26598 __tmp.put_u8(self.target_component);
26599 __tmp.put_u8(self.reason as u8);
26600 if matches!(version, MavlinkVersion::V2) {
26601 let len = __tmp.len();
26602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26603 } else {
26604 __tmp.len()
26605 }
26606 }
26607}
26608#[doc = "Read out the safety zone the MAV currently assumes."]
26609#[doc = ""]
26610#[doc = "ID: 55"]
26611#[derive(Debug, Clone, PartialEq)]
26612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26614#[cfg_attr(feature = "ts", derive(TS))]
26615#[cfg_attr(feature = "ts", ts(export))]
26616pub struct SAFETY_ALLOWED_AREA_DATA {
26617 #[doc = "x position 1 / Latitude 1"]
26618 pub p1x: f32,
26619 #[doc = "y position 1 / Longitude 1"]
26620 pub p1y: f32,
26621 #[doc = "z position 1 / Altitude 1"]
26622 pub p1z: f32,
26623 #[doc = "x position 2 / Latitude 2"]
26624 pub p2x: f32,
26625 #[doc = "y position 2 / Longitude 2"]
26626 pub p2y: f32,
26627 #[doc = "z position 2 / Altitude 2"]
26628 pub p2z: f32,
26629 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26630 pub frame: MavFrame,
26631}
26632impl SAFETY_ALLOWED_AREA_DATA {
26633 pub const ENCODED_LEN: usize = 25usize;
26634 pub const DEFAULT: Self = Self {
26635 p1x: 0.0_f32,
26636 p1y: 0.0_f32,
26637 p1z: 0.0_f32,
26638 p2x: 0.0_f32,
26639 p2y: 0.0_f32,
26640 p2z: 0.0_f32,
26641 frame: MavFrame::DEFAULT,
26642 };
26643 #[cfg(feature = "arbitrary")]
26644 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26645 use arbitrary::{Arbitrary, Unstructured};
26646 let mut buf = [0u8; 1024];
26647 rng.fill_bytes(&mut buf);
26648 let mut unstructured = Unstructured::new(&buf);
26649 Self::arbitrary(&mut unstructured).unwrap_or_default()
26650 }
26651}
26652impl Default for SAFETY_ALLOWED_AREA_DATA {
26653 fn default() -> Self {
26654 Self::DEFAULT.clone()
26655 }
26656}
26657impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26658 type Message = MavMessage;
26659 const ID: u32 = 55u32;
26660 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26661 const EXTRA_CRC: u8 = 3u8;
26662 const ENCODED_LEN: usize = 25usize;
26663 fn deser(
26664 _version: MavlinkVersion,
26665 __input: &[u8],
26666 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26667 let avail_len = __input.len();
26668 let mut payload_buf = [0; Self::ENCODED_LEN];
26669 let mut buf = if avail_len < Self::ENCODED_LEN {
26670 payload_buf[0..avail_len].copy_from_slice(__input);
26671 Bytes::new(&payload_buf)
26672 } else {
26673 Bytes::new(__input)
26674 };
26675 let mut __struct = Self::default();
26676 __struct.p1x = buf.get_f32_le();
26677 __struct.p1y = buf.get_f32_le();
26678 __struct.p1z = buf.get_f32_le();
26679 __struct.p2x = buf.get_f32_le();
26680 __struct.p2y = buf.get_f32_le();
26681 __struct.p2z = buf.get_f32_le();
26682 let tmp = buf.get_u8();
26683 __struct.frame =
26684 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26685 enum_type: "MavFrame",
26686 value: tmp as u32,
26687 })?;
26688 Ok(__struct)
26689 }
26690 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26691 let mut __tmp = BytesMut::new(bytes);
26692 #[allow(clippy::absurd_extreme_comparisons)]
26693 #[allow(unused_comparisons)]
26694 if __tmp.remaining() < Self::ENCODED_LEN {
26695 panic!(
26696 "buffer is too small (need {} bytes, but got {})",
26697 Self::ENCODED_LEN,
26698 __tmp.remaining(),
26699 )
26700 }
26701 __tmp.put_f32_le(self.p1x);
26702 __tmp.put_f32_le(self.p1y);
26703 __tmp.put_f32_le(self.p1z);
26704 __tmp.put_f32_le(self.p2x);
26705 __tmp.put_f32_le(self.p2y);
26706 __tmp.put_f32_le(self.p2z);
26707 __tmp.put_u8(self.frame as u8);
26708 if matches!(version, MavlinkVersion::V2) {
26709 let len = __tmp.len();
26710 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26711 } else {
26712 __tmp.len()
26713 }
26714 }
26715}
26716#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26717#[doc = ""]
26718#[doc = "ID: 54"]
26719#[derive(Debug, Clone, PartialEq)]
26720#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26721#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26722#[cfg_attr(feature = "ts", derive(TS))]
26723#[cfg_attr(feature = "ts", ts(export))]
26724pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26725 #[doc = "x position 1 / Latitude 1"]
26726 pub p1x: f32,
26727 #[doc = "y position 1 / Longitude 1"]
26728 pub p1y: f32,
26729 #[doc = "z position 1 / Altitude 1"]
26730 pub p1z: f32,
26731 #[doc = "x position 2 / Latitude 2"]
26732 pub p2x: f32,
26733 #[doc = "y position 2 / Longitude 2"]
26734 pub p2y: f32,
26735 #[doc = "z position 2 / Altitude 2"]
26736 pub p2z: f32,
26737 #[doc = "System ID"]
26738 pub target_system: u8,
26739 #[doc = "Component ID"]
26740 pub target_component: u8,
26741 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26742 pub frame: MavFrame,
26743}
26744impl SAFETY_SET_ALLOWED_AREA_DATA {
26745 pub const ENCODED_LEN: usize = 27usize;
26746 pub const DEFAULT: Self = Self {
26747 p1x: 0.0_f32,
26748 p1y: 0.0_f32,
26749 p1z: 0.0_f32,
26750 p2x: 0.0_f32,
26751 p2y: 0.0_f32,
26752 p2z: 0.0_f32,
26753 target_system: 0_u8,
26754 target_component: 0_u8,
26755 frame: MavFrame::DEFAULT,
26756 };
26757 #[cfg(feature = "arbitrary")]
26758 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26759 use arbitrary::{Arbitrary, Unstructured};
26760 let mut buf = [0u8; 1024];
26761 rng.fill_bytes(&mut buf);
26762 let mut unstructured = Unstructured::new(&buf);
26763 Self::arbitrary(&mut unstructured).unwrap_or_default()
26764 }
26765}
26766impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26767 fn default() -> Self {
26768 Self::DEFAULT.clone()
26769 }
26770}
26771impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26772 type Message = MavMessage;
26773 const ID: u32 = 54u32;
26774 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26775 const EXTRA_CRC: u8 = 15u8;
26776 const ENCODED_LEN: usize = 27usize;
26777 fn deser(
26778 _version: MavlinkVersion,
26779 __input: &[u8],
26780 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26781 let avail_len = __input.len();
26782 let mut payload_buf = [0; Self::ENCODED_LEN];
26783 let mut buf = if avail_len < Self::ENCODED_LEN {
26784 payload_buf[0..avail_len].copy_from_slice(__input);
26785 Bytes::new(&payload_buf)
26786 } else {
26787 Bytes::new(__input)
26788 };
26789 let mut __struct = Self::default();
26790 __struct.p1x = buf.get_f32_le();
26791 __struct.p1y = buf.get_f32_le();
26792 __struct.p1z = buf.get_f32_le();
26793 __struct.p2x = buf.get_f32_le();
26794 __struct.p2y = buf.get_f32_le();
26795 __struct.p2z = buf.get_f32_le();
26796 __struct.target_system = buf.get_u8();
26797 __struct.target_component = buf.get_u8();
26798 let tmp = buf.get_u8();
26799 __struct.frame =
26800 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26801 enum_type: "MavFrame",
26802 value: tmp as u32,
26803 })?;
26804 Ok(__struct)
26805 }
26806 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26807 let mut __tmp = BytesMut::new(bytes);
26808 #[allow(clippy::absurd_extreme_comparisons)]
26809 #[allow(unused_comparisons)]
26810 if __tmp.remaining() < Self::ENCODED_LEN {
26811 panic!(
26812 "buffer is too small (need {} bytes, but got {})",
26813 Self::ENCODED_LEN,
26814 __tmp.remaining(),
26815 )
26816 }
26817 __tmp.put_f32_le(self.p1x);
26818 __tmp.put_f32_le(self.p1y);
26819 __tmp.put_f32_le(self.p1z);
26820 __tmp.put_f32_le(self.p2x);
26821 __tmp.put_f32_le(self.p2y);
26822 __tmp.put_f32_le(self.p2z);
26823 __tmp.put_u8(self.target_system);
26824 __tmp.put_u8(self.target_component);
26825 __tmp.put_u8(self.frame as u8);
26826 if matches!(version, MavlinkVersion::V2) {
26827 let len = __tmp.len();
26828 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26829 } else {
26830 __tmp.len()
26831 }
26832 }
26833}
26834#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26835#[doc = ""]
26836#[doc = "ID: 26"]
26837#[derive(Debug, Clone, PartialEq)]
26838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26839#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26840#[cfg_attr(feature = "ts", derive(TS))]
26841#[cfg_attr(feature = "ts", ts(export))]
26842pub struct SCALED_IMU_DATA {
26843 #[doc = "Timestamp (time since system boot)."]
26844 pub time_boot_ms: u32,
26845 #[doc = "X acceleration"]
26846 pub xacc: i16,
26847 #[doc = "Y acceleration"]
26848 pub yacc: i16,
26849 #[doc = "Z acceleration"]
26850 pub zacc: i16,
26851 #[doc = "Angular speed around X axis"]
26852 pub xgyro: i16,
26853 #[doc = "Angular speed around Y axis"]
26854 pub ygyro: i16,
26855 #[doc = "Angular speed around Z axis"]
26856 pub zgyro: i16,
26857 #[doc = "X Magnetic field"]
26858 pub xmag: i16,
26859 #[doc = "Y Magnetic field"]
26860 pub ymag: i16,
26861 #[doc = "Z Magnetic field"]
26862 pub zmag: i16,
26863 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26864 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26865 pub temperature: i16,
26866}
26867impl SCALED_IMU_DATA {
26868 pub const ENCODED_LEN: usize = 24usize;
26869 pub const DEFAULT: Self = Self {
26870 time_boot_ms: 0_u32,
26871 xacc: 0_i16,
26872 yacc: 0_i16,
26873 zacc: 0_i16,
26874 xgyro: 0_i16,
26875 ygyro: 0_i16,
26876 zgyro: 0_i16,
26877 xmag: 0_i16,
26878 ymag: 0_i16,
26879 zmag: 0_i16,
26880 temperature: 0_i16,
26881 };
26882 #[cfg(feature = "arbitrary")]
26883 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26884 use arbitrary::{Arbitrary, Unstructured};
26885 let mut buf = [0u8; 1024];
26886 rng.fill_bytes(&mut buf);
26887 let mut unstructured = Unstructured::new(&buf);
26888 Self::arbitrary(&mut unstructured).unwrap_or_default()
26889 }
26890}
26891impl Default for SCALED_IMU_DATA {
26892 fn default() -> Self {
26893 Self::DEFAULT.clone()
26894 }
26895}
26896impl MessageData for SCALED_IMU_DATA {
26897 type Message = MavMessage;
26898 const ID: u32 = 26u32;
26899 const NAME: &'static str = "SCALED_IMU";
26900 const EXTRA_CRC: u8 = 170u8;
26901 const ENCODED_LEN: usize = 24usize;
26902 fn deser(
26903 _version: MavlinkVersion,
26904 __input: &[u8],
26905 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26906 let avail_len = __input.len();
26907 let mut payload_buf = [0; Self::ENCODED_LEN];
26908 let mut buf = if avail_len < Self::ENCODED_LEN {
26909 payload_buf[0..avail_len].copy_from_slice(__input);
26910 Bytes::new(&payload_buf)
26911 } else {
26912 Bytes::new(__input)
26913 };
26914 let mut __struct = Self::default();
26915 __struct.time_boot_ms = buf.get_u32_le();
26916 __struct.xacc = buf.get_i16_le();
26917 __struct.yacc = buf.get_i16_le();
26918 __struct.zacc = buf.get_i16_le();
26919 __struct.xgyro = buf.get_i16_le();
26920 __struct.ygyro = buf.get_i16_le();
26921 __struct.zgyro = buf.get_i16_le();
26922 __struct.xmag = buf.get_i16_le();
26923 __struct.ymag = buf.get_i16_le();
26924 __struct.zmag = buf.get_i16_le();
26925 __struct.temperature = buf.get_i16_le();
26926 Ok(__struct)
26927 }
26928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26929 let mut __tmp = BytesMut::new(bytes);
26930 #[allow(clippy::absurd_extreme_comparisons)]
26931 #[allow(unused_comparisons)]
26932 if __tmp.remaining() < Self::ENCODED_LEN {
26933 panic!(
26934 "buffer is too small (need {} bytes, but got {})",
26935 Self::ENCODED_LEN,
26936 __tmp.remaining(),
26937 )
26938 }
26939 __tmp.put_u32_le(self.time_boot_ms);
26940 __tmp.put_i16_le(self.xacc);
26941 __tmp.put_i16_le(self.yacc);
26942 __tmp.put_i16_le(self.zacc);
26943 __tmp.put_i16_le(self.xgyro);
26944 __tmp.put_i16_le(self.ygyro);
26945 __tmp.put_i16_le(self.zgyro);
26946 __tmp.put_i16_le(self.xmag);
26947 __tmp.put_i16_le(self.ymag);
26948 __tmp.put_i16_le(self.zmag);
26949 if matches!(version, MavlinkVersion::V2) {
26950 __tmp.put_i16_le(self.temperature);
26951 let len = __tmp.len();
26952 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26953 } else {
26954 __tmp.len()
26955 }
26956 }
26957}
26958#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26959#[doc = ""]
26960#[doc = "ID: 116"]
26961#[derive(Debug, Clone, PartialEq)]
26962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26964#[cfg_attr(feature = "ts", derive(TS))]
26965#[cfg_attr(feature = "ts", ts(export))]
26966pub struct SCALED_IMU2_DATA {
26967 #[doc = "Timestamp (time since system boot)."]
26968 pub time_boot_ms: u32,
26969 #[doc = "X acceleration"]
26970 pub xacc: i16,
26971 #[doc = "Y acceleration"]
26972 pub yacc: i16,
26973 #[doc = "Z acceleration"]
26974 pub zacc: i16,
26975 #[doc = "Angular speed around X axis"]
26976 pub xgyro: i16,
26977 #[doc = "Angular speed around Y axis"]
26978 pub ygyro: i16,
26979 #[doc = "Angular speed around Z axis"]
26980 pub zgyro: i16,
26981 #[doc = "X Magnetic field"]
26982 pub xmag: i16,
26983 #[doc = "Y Magnetic field"]
26984 pub ymag: i16,
26985 #[doc = "Z Magnetic field"]
26986 pub zmag: i16,
26987 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26988 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26989 pub temperature: i16,
26990}
26991impl SCALED_IMU2_DATA {
26992 pub const ENCODED_LEN: usize = 24usize;
26993 pub const DEFAULT: Self = Self {
26994 time_boot_ms: 0_u32,
26995 xacc: 0_i16,
26996 yacc: 0_i16,
26997 zacc: 0_i16,
26998 xgyro: 0_i16,
26999 ygyro: 0_i16,
27000 zgyro: 0_i16,
27001 xmag: 0_i16,
27002 ymag: 0_i16,
27003 zmag: 0_i16,
27004 temperature: 0_i16,
27005 };
27006 #[cfg(feature = "arbitrary")]
27007 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27008 use arbitrary::{Arbitrary, Unstructured};
27009 let mut buf = [0u8; 1024];
27010 rng.fill_bytes(&mut buf);
27011 let mut unstructured = Unstructured::new(&buf);
27012 Self::arbitrary(&mut unstructured).unwrap_or_default()
27013 }
27014}
27015impl Default for SCALED_IMU2_DATA {
27016 fn default() -> Self {
27017 Self::DEFAULT.clone()
27018 }
27019}
27020impl MessageData for SCALED_IMU2_DATA {
27021 type Message = MavMessage;
27022 const ID: u32 = 116u32;
27023 const NAME: &'static str = "SCALED_IMU2";
27024 const EXTRA_CRC: u8 = 76u8;
27025 const ENCODED_LEN: usize = 24usize;
27026 fn deser(
27027 _version: MavlinkVersion,
27028 __input: &[u8],
27029 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27030 let avail_len = __input.len();
27031 let mut payload_buf = [0; Self::ENCODED_LEN];
27032 let mut buf = if avail_len < Self::ENCODED_LEN {
27033 payload_buf[0..avail_len].copy_from_slice(__input);
27034 Bytes::new(&payload_buf)
27035 } else {
27036 Bytes::new(__input)
27037 };
27038 let mut __struct = Self::default();
27039 __struct.time_boot_ms = buf.get_u32_le();
27040 __struct.xacc = buf.get_i16_le();
27041 __struct.yacc = buf.get_i16_le();
27042 __struct.zacc = buf.get_i16_le();
27043 __struct.xgyro = buf.get_i16_le();
27044 __struct.ygyro = buf.get_i16_le();
27045 __struct.zgyro = buf.get_i16_le();
27046 __struct.xmag = buf.get_i16_le();
27047 __struct.ymag = buf.get_i16_le();
27048 __struct.zmag = buf.get_i16_le();
27049 __struct.temperature = buf.get_i16_le();
27050 Ok(__struct)
27051 }
27052 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27053 let mut __tmp = BytesMut::new(bytes);
27054 #[allow(clippy::absurd_extreme_comparisons)]
27055 #[allow(unused_comparisons)]
27056 if __tmp.remaining() < Self::ENCODED_LEN {
27057 panic!(
27058 "buffer is too small (need {} bytes, but got {})",
27059 Self::ENCODED_LEN,
27060 __tmp.remaining(),
27061 )
27062 }
27063 __tmp.put_u32_le(self.time_boot_ms);
27064 __tmp.put_i16_le(self.xacc);
27065 __tmp.put_i16_le(self.yacc);
27066 __tmp.put_i16_le(self.zacc);
27067 __tmp.put_i16_le(self.xgyro);
27068 __tmp.put_i16_le(self.ygyro);
27069 __tmp.put_i16_le(self.zgyro);
27070 __tmp.put_i16_le(self.xmag);
27071 __tmp.put_i16_le(self.ymag);
27072 __tmp.put_i16_le(self.zmag);
27073 if matches!(version, MavlinkVersion::V2) {
27074 __tmp.put_i16_le(self.temperature);
27075 let len = __tmp.len();
27076 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27077 } else {
27078 __tmp.len()
27079 }
27080 }
27081}
27082#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27083#[doc = ""]
27084#[doc = "ID: 129"]
27085#[derive(Debug, Clone, PartialEq)]
27086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27088#[cfg_attr(feature = "ts", derive(TS))]
27089#[cfg_attr(feature = "ts", ts(export))]
27090pub struct SCALED_IMU3_DATA {
27091 #[doc = "Timestamp (time since system boot)."]
27092 pub time_boot_ms: u32,
27093 #[doc = "X acceleration"]
27094 pub xacc: i16,
27095 #[doc = "Y acceleration"]
27096 pub yacc: i16,
27097 #[doc = "Z acceleration"]
27098 pub zacc: i16,
27099 #[doc = "Angular speed around X axis"]
27100 pub xgyro: i16,
27101 #[doc = "Angular speed around Y axis"]
27102 pub ygyro: i16,
27103 #[doc = "Angular speed around Z axis"]
27104 pub zgyro: i16,
27105 #[doc = "X Magnetic field"]
27106 pub xmag: i16,
27107 #[doc = "Y Magnetic field"]
27108 pub ymag: i16,
27109 #[doc = "Z Magnetic field"]
27110 pub zmag: i16,
27111 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27112 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27113 pub temperature: i16,
27114}
27115impl SCALED_IMU3_DATA {
27116 pub const ENCODED_LEN: usize = 24usize;
27117 pub const DEFAULT: Self = Self {
27118 time_boot_ms: 0_u32,
27119 xacc: 0_i16,
27120 yacc: 0_i16,
27121 zacc: 0_i16,
27122 xgyro: 0_i16,
27123 ygyro: 0_i16,
27124 zgyro: 0_i16,
27125 xmag: 0_i16,
27126 ymag: 0_i16,
27127 zmag: 0_i16,
27128 temperature: 0_i16,
27129 };
27130 #[cfg(feature = "arbitrary")]
27131 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27132 use arbitrary::{Arbitrary, Unstructured};
27133 let mut buf = [0u8; 1024];
27134 rng.fill_bytes(&mut buf);
27135 let mut unstructured = Unstructured::new(&buf);
27136 Self::arbitrary(&mut unstructured).unwrap_or_default()
27137 }
27138}
27139impl Default for SCALED_IMU3_DATA {
27140 fn default() -> Self {
27141 Self::DEFAULT.clone()
27142 }
27143}
27144impl MessageData for SCALED_IMU3_DATA {
27145 type Message = MavMessage;
27146 const ID: u32 = 129u32;
27147 const NAME: &'static str = "SCALED_IMU3";
27148 const EXTRA_CRC: u8 = 46u8;
27149 const ENCODED_LEN: usize = 24usize;
27150 fn deser(
27151 _version: MavlinkVersion,
27152 __input: &[u8],
27153 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27154 let avail_len = __input.len();
27155 let mut payload_buf = [0; Self::ENCODED_LEN];
27156 let mut buf = if avail_len < Self::ENCODED_LEN {
27157 payload_buf[0..avail_len].copy_from_slice(__input);
27158 Bytes::new(&payload_buf)
27159 } else {
27160 Bytes::new(__input)
27161 };
27162 let mut __struct = Self::default();
27163 __struct.time_boot_ms = buf.get_u32_le();
27164 __struct.xacc = buf.get_i16_le();
27165 __struct.yacc = buf.get_i16_le();
27166 __struct.zacc = buf.get_i16_le();
27167 __struct.xgyro = buf.get_i16_le();
27168 __struct.ygyro = buf.get_i16_le();
27169 __struct.zgyro = buf.get_i16_le();
27170 __struct.xmag = buf.get_i16_le();
27171 __struct.ymag = buf.get_i16_le();
27172 __struct.zmag = buf.get_i16_le();
27173 __struct.temperature = buf.get_i16_le();
27174 Ok(__struct)
27175 }
27176 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27177 let mut __tmp = BytesMut::new(bytes);
27178 #[allow(clippy::absurd_extreme_comparisons)]
27179 #[allow(unused_comparisons)]
27180 if __tmp.remaining() < Self::ENCODED_LEN {
27181 panic!(
27182 "buffer is too small (need {} bytes, but got {})",
27183 Self::ENCODED_LEN,
27184 __tmp.remaining(),
27185 )
27186 }
27187 __tmp.put_u32_le(self.time_boot_ms);
27188 __tmp.put_i16_le(self.xacc);
27189 __tmp.put_i16_le(self.yacc);
27190 __tmp.put_i16_le(self.zacc);
27191 __tmp.put_i16_le(self.xgyro);
27192 __tmp.put_i16_le(self.ygyro);
27193 __tmp.put_i16_le(self.zgyro);
27194 __tmp.put_i16_le(self.xmag);
27195 __tmp.put_i16_le(self.ymag);
27196 __tmp.put_i16_le(self.zmag);
27197 if matches!(version, MavlinkVersion::V2) {
27198 __tmp.put_i16_le(self.temperature);
27199 let len = __tmp.len();
27200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27201 } else {
27202 __tmp.len()
27203 }
27204 }
27205}
27206#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27207#[doc = ""]
27208#[doc = "ID: 29"]
27209#[derive(Debug, Clone, PartialEq)]
27210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27211#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27212#[cfg_attr(feature = "ts", derive(TS))]
27213#[cfg_attr(feature = "ts", ts(export))]
27214pub struct SCALED_PRESSURE_DATA {
27215 #[doc = "Timestamp (time since system boot)."]
27216 pub time_boot_ms: u32,
27217 #[doc = "Absolute pressure"]
27218 pub press_abs: f32,
27219 #[doc = "Differential pressure 1"]
27220 pub press_diff: f32,
27221 #[doc = "Absolute pressure temperature"]
27222 pub temperature: i16,
27223 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27224 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27225 pub temperature_press_diff: i16,
27226}
27227impl SCALED_PRESSURE_DATA {
27228 pub const ENCODED_LEN: usize = 16usize;
27229 pub const DEFAULT: Self = Self {
27230 time_boot_ms: 0_u32,
27231 press_abs: 0.0_f32,
27232 press_diff: 0.0_f32,
27233 temperature: 0_i16,
27234 temperature_press_diff: 0_i16,
27235 };
27236 #[cfg(feature = "arbitrary")]
27237 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27238 use arbitrary::{Arbitrary, Unstructured};
27239 let mut buf = [0u8; 1024];
27240 rng.fill_bytes(&mut buf);
27241 let mut unstructured = Unstructured::new(&buf);
27242 Self::arbitrary(&mut unstructured).unwrap_or_default()
27243 }
27244}
27245impl Default for SCALED_PRESSURE_DATA {
27246 fn default() -> Self {
27247 Self::DEFAULT.clone()
27248 }
27249}
27250impl MessageData for SCALED_PRESSURE_DATA {
27251 type Message = MavMessage;
27252 const ID: u32 = 29u32;
27253 const NAME: &'static str = "SCALED_PRESSURE";
27254 const EXTRA_CRC: u8 = 115u8;
27255 const ENCODED_LEN: usize = 16usize;
27256 fn deser(
27257 _version: MavlinkVersion,
27258 __input: &[u8],
27259 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27260 let avail_len = __input.len();
27261 let mut payload_buf = [0; Self::ENCODED_LEN];
27262 let mut buf = if avail_len < Self::ENCODED_LEN {
27263 payload_buf[0..avail_len].copy_from_slice(__input);
27264 Bytes::new(&payload_buf)
27265 } else {
27266 Bytes::new(__input)
27267 };
27268 let mut __struct = Self::default();
27269 __struct.time_boot_ms = buf.get_u32_le();
27270 __struct.press_abs = buf.get_f32_le();
27271 __struct.press_diff = buf.get_f32_le();
27272 __struct.temperature = buf.get_i16_le();
27273 __struct.temperature_press_diff = buf.get_i16_le();
27274 Ok(__struct)
27275 }
27276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27277 let mut __tmp = BytesMut::new(bytes);
27278 #[allow(clippy::absurd_extreme_comparisons)]
27279 #[allow(unused_comparisons)]
27280 if __tmp.remaining() < Self::ENCODED_LEN {
27281 panic!(
27282 "buffer is too small (need {} bytes, but got {})",
27283 Self::ENCODED_LEN,
27284 __tmp.remaining(),
27285 )
27286 }
27287 __tmp.put_u32_le(self.time_boot_ms);
27288 __tmp.put_f32_le(self.press_abs);
27289 __tmp.put_f32_le(self.press_diff);
27290 __tmp.put_i16_le(self.temperature);
27291 if matches!(version, MavlinkVersion::V2) {
27292 __tmp.put_i16_le(self.temperature_press_diff);
27293 let len = __tmp.len();
27294 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27295 } else {
27296 __tmp.len()
27297 }
27298 }
27299}
27300#[doc = "Barometer readings for 2nd barometer."]
27301#[doc = ""]
27302#[doc = "ID: 137"]
27303#[derive(Debug, Clone, PartialEq)]
27304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27306#[cfg_attr(feature = "ts", derive(TS))]
27307#[cfg_attr(feature = "ts", ts(export))]
27308pub struct SCALED_PRESSURE2_DATA {
27309 #[doc = "Timestamp (time since system boot)."]
27310 pub time_boot_ms: u32,
27311 #[doc = "Absolute pressure"]
27312 pub press_abs: f32,
27313 #[doc = "Differential pressure"]
27314 pub press_diff: f32,
27315 #[doc = "Absolute pressure temperature"]
27316 pub temperature: i16,
27317 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27318 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27319 pub temperature_press_diff: i16,
27320}
27321impl SCALED_PRESSURE2_DATA {
27322 pub const ENCODED_LEN: usize = 16usize;
27323 pub const DEFAULT: Self = Self {
27324 time_boot_ms: 0_u32,
27325 press_abs: 0.0_f32,
27326 press_diff: 0.0_f32,
27327 temperature: 0_i16,
27328 temperature_press_diff: 0_i16,
27329 };
27330 #[cfg(feature = "arbitrary")]
27331 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27332 use arbitrary::{Arbitrary, Unstructured};
27333 let mut buf = [0u8; 1024];
27334 rng.fill_bytes(&mut buf);
27335 let mut unstructured = Unstructured::new(&buf);
27336 Self::arbitrary(&mut unstructured).unwrap_or_default()
27337 }
27338}
27339impl Default for SCALED_PRESSURE2_DATA {
27340 fn default() -> Self {
27341 Self::DEFAULT.clone()
27342 }
27343}
27344impl MessageData for SCALED_PRESSURE2_DATA {
27345 type Message = MavMessage;
27346 const ID: u32 = 137u32;
27347 const NAME: &'static str = "SCALED_PRESSURE2";
27348 const EXTRA_CRC: u8 = 195u8;
27349 const ENCODED_LEN: usize = 16usize;
27350 fn deser(
27351 _version: MavlinkVersion,
27352 __input: &[u8],
27353 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27354 let avail_len = __input.len();
27355 let mut payload_buf = [0; Self::ENCODED_LEN];
27356 let mut buf = if avail_len < Self::ENCODED_LEN {
27357 payload_buf[0..avail_len].copy_from_slice(__input);
27358 Bytes::new(&payload_buf)
27359 } else {
27360 Bytes::new(__input)
27361 };
27362 let mut __struct = Self::default();
27363 __struct.time_boot_ms = buf.get_u32_le();
27364 __struct.press_abs = buf.get_f32_le();
27365 __struct.press_diff = buf.get_f32_le();
27366 __struct.temperature = buf.get_i16_le();
27367 __struct.temperature_press_diff = buf.get_i16_le();
27368 Ok(__struct)
27369 }
27370 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27371 let mut __tmp = BytesMut::new(bytes);
27372 #[allow(clippy::absurd_extreme_comparisons)]
27373 #[allow(unused_comparisons)]
27374 if __tmp.remaining() < Self::ENCODED_LEN {
27375 panic!(
27376 "buffer is too small (need {} bytes, but got {})",
27377 Self::ENCODED_LEN,
27378 __tmp.remaining(),
27379 )
27380 }
27381 __tmp.put_u32_le(self.time_boot_ms);
27382 __tmp.put_f32_le(self.press_abs);
27383 __tmp.put_f32_le(self.press_diff);
27384 __tmp.put_i16_le(self.temperature);
27385 if matches!(version, MavlinkVersion::V2) {
27386 __tmp.put_i16_le(self.temperature_press_diff);
27387 let len = __tmp.len();
27388 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27389 } else {
27390 __tmp.len()
27391 }
27392 }
27393}
27394#[doc = "Barometer readings for 3rd barometer."]
27395#[doc = ""]
27396#[doc = "ID: 143"]
27397#[derive(Debug, Clone, PartialEq)]
27398#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27400#[cfg_attr(feature = "ts", derive(TS))]
27401#[cfg_attr(feature = "ts", ts(export))]
27402pub struct SCALED_PRESSURE3_DATA {
27403 #[doc = "Timestamp (time since system boot)."]
27404 pub time_boot_ms: u32,
27405 #[doc = "Absolute pressure"]
27406 pub press_abs: f32,
27407 #[doc = "Differential pressure"]
27408 pub press_diff: f32,
27409 #[doc = "Absolute pressure temperature"]
27410 pub temperature: i16,
27411 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27412 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27413 pub temperature_press_diff: i16,
27414}
27415impl SCALED_PRESSURE3_DATA {
27416 pub const ENCODED_LEN: usize = 16usize;
27417 pub const DEFAULT: Self = Self {
27418 time_boot_ms: 0_u32,
27419 press_abs: 0.0_f32,
27420 press_diff: 0.0_f32,
27421 temperature: 0_i16,
27422 temperature_press_diff: 0_i16,
27423 };
27424 #[cfg(feature = "arbitrary")]
27425 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27426 use arbitrary::{Arbitrary, Unstructured};
27427 let mut buf = [0u8; 1024];
27428 rng.fill_bytes(&mut buf);
27429 let mut unstructured = Unstructured::new(&buf);
27430 Self::arbitrary(&mut unstructured).unwrap_or_default()
27431 }
27432}
27433impl Default for SCALED_PRESSURE3_DATA {
27434 fn default() -> Self {
27435 Self::DEFAULT.clone()
27436 }
27437}
27438impl MessageData for SCALED_PRESSURE3_DATA {
27439 type Message = MavMessage;
27440 const ID: u32 = 143u32;
27441 const NAME: &'static str = "SCALED_PRESSURE3";
27442 const EXTRA_CRC: u8 = 131u8;
27443 const ENCODED_LEN: usize = 16usize;
27444 fn deser(
27445 _version: MavlinkVersion,
27446 __input: &[u8],
27447 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27448 let avail_len = __input.len();
27449 let mut payload_buf = [0; Self::ENCODED_LEN];
27450 let mut buf = if avail_len < Self::ENCODED_LEN {
27451 payload_buf[0..avail_len].copy_from_slice(__input);
27452 Bytes::new(&payload_buf)
27453 } else {
27454 Bytes::new(__input)
27455 };
27456 let mut __struct = Self::default();
27457 __struct.time_boot_ms = buf.get_u32_le();
27458 __struct.press_abs = buf.get_f32_le();
27459 __struct.press_diff = buf.get_f32_le();
27460 __struct.temperature = buf.get_i16_le();
27461 __struct.temperature_press_diff = buf.get_i16_le();
27462 Ok(__struct)
27463 }
27464 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27465 let mut __tmp = BytesMut::new(bytes);
27466 #[allow(clippy::absurd_extreme_comparisons)]
27467 #[allow(unused_comparisons)]
27468 if __tmp.remaining() < Self::ENCODED_LEN {
27469 panic!(
27470 "buffer is too small (need {} bytes, but got {})",
27471 Self::ENCODED_LEN,
27472 __tmp.remaining(),
27473 )
27474 }
27475 __tmp.put_u32_le(self.time_boot_ms);
27476 __tmp.put_f32_le(self.press_abs);
27477 __tmp.put_f32_le(self.press_diff);
27478 __tmp.put_i16_le(self.temperature);
27479 if matches!(version, MavlinkVersion::V2) {
27480 __tmp.put_i16_le(self.temperature_press_diff);
27481 let len = __tmp.len();
27482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27483 } else {
27484 __tmp.len()
27485 }
27486 }
27487}
27488#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27489#[doc = ""]
27490#[doc = "ID: 126"]
27491#[derive(Debug, Clone, PartialEq)]
27492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27493#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27494#[cfg_attr(feature = "ts", derive(TS))]
27495#[cfg_attr(feature = "ts", ts(export))]
27496pub struct SERIAL_CONTROL_DATA {
27497 #[doc = "Baudrate of transfer. Zero means no change."]
27498 pub baudrate: u32,
27499 #[doc = "Timeout for reply data"]
27500 pub timeout: u16,
27501 #[doc = "Serial control device type."]
27502 pub device: SerialControlDev,
27503 #[doc = "Bitmap of serial control flags."]
27504 pub flags: SerialControlFlag,
27505 #[doc = "how many bytes in this transfer"]
27506 pub count: u8,
27507 #[doc = "serial data"]
27508 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27509 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27510 pub data: [u8; 70],
27511 #[doc = "System ID"]
27512 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27513 pub target_system: u8,
27514 #[doc = "Component ID"]
27515 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27516 pub target_component: u8,
27517}
27518impl SERIAL_CONTROL_DATA {
27519 pub const ENCODED_LEN: usize = 81usize;
27520 pub const DEFAULT: Self = Self {
27521 baudrate: 0_u32,
27522 timeout: 0_u16,
27523 device: SerialControlDev::DEFAULT,
27524 flags: SerialControlFlag::DEFAULT,
27525 count: 0_u8,
27526 data: [0_u8; 70usize],
27527 target_system: 0_u8,
27528 target_component: 0_u8,
27529 };
27530 #[cfg(feature = "arbitrary")]
27531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27532 use arbitrary::{Arbitrary, Unstructured};
27533 let mut buf = [0u8; 1024];
27534 rng.fill_bytes(&mut buf);
27535 let mut unstructured = Unstructured::new(&buf);
27536 Self::arbitrary(&mut unstructured).unwrap_or_default()
27537 }
27538}
27539impl Default for SERIAL_CONTROL_DATA {
27540 fn default() -> Self {
27541 Self::DEFAULT.clone()
27542 }
27543}
27544impl MessageData for SERIAL_CONTROL_DATA {
27545 type Message = MavMessage;
27546 const ID: u32 = 126u32;
27547 const NAME: &'static str = "SERIAL_CONTROL";
27548 const EXTRA_CRC: u8 = 220u8;
27549 const ENCODED_LEN: usize = 81usize;
27550 fn deser(
27551 _version: MavlinkVersion,
27552 __input: &[u8],
27553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27554 let avail_len = __input.len();
27555 let mut payload_buf = [0; Self::ENCODED_LEN];
27556 let mut buf = if avail_len < Self::ENCODED_LEN {
27557 payload_buf[0..avail_len].copy_from_slice(__input);
27558 Bytes::new(&payload_buf)
27559 } else {
27560 Bytes::new(__input)
27561 };
27562 let mut __struct = Self::default();
27563 __struct.baudrate = buf.get_u32_le();
27564 __struct.timeout = buf.get_u16_le();
27565 let tmp = buf.get_u8();
27566 __struct.device =
27567 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27568 enum_type: "SerialControlDev",
27569 value: tmp as u32,
27570 })?;
27571 let tmp = buf.get_u8();
27572 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
27573 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27574 flag_type: "SerialControlFlag",
27575 value: tmp as u32,
27576 })?;
27577 __struct.count = buf.get_u8();
27578 for v in &mut __struct.data {
27579 let val = buf.get_u8();
27580 *v = val;
27581 }
27582 __struct.target_system = buf.get_u8();
27583 __struct.target_component = buf.get_u8();
27584 Ok(__struct)
27585 }
27586 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27587 let mut __tmp = BytesMut::new(bytes);
27588 #[allow(clippy::absurd_extreme_comparisons)]
27589 #[allow(unused_comparisons)]
27590 if __tmp.remaining() < Self::ENCODED_LEN {
27591 panic!(
27592 "buffer is too small (need {} bytes, but got {})",
27593 Self::ENCODED_LEN,
27594 __tmp.remaining(),
27595 )
27596 }
27597 __tmp.put_u32_le(self.baudrate);
27598 __tmp.put_u16_le(self.timeout);
27599 __tmp.put_u8(self.device as u8);
27600 __tmp.put_u8(self.flags.bits());
27601 __tmp.put_u8(self.count);
27602 for val in &self.data {
27603 __tmp.put_u8(*val);
27604 }
27605 if matches!(version, MavlinkVersion::V2) {
27606 __tmp.put_u8(self.target_system);
27607 __tmp.put_u8(self.target_component);
27608 let len = __tmp.len();
27609 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27610 } else {
27611 __tmp.len()
27612 }
27613 }
27614}
27615#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27616#[doc = ""]
27617#[doc = "ID: 36"]
27618#[derive(Debug, Clone, PartialEq)]
27619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27621#[cfg_attr(feature = "ts", derive(TS))]
27622#[cfg_attr(feature = "ts", ts(export))]
27623pub struct SERVO_OUTPUT_RAW_DATA {
27624 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27625 pub time_usec: u32,
27626 #[doc = "Servo output 1 value"]
27627 pub servo1_raw: u16,
27628 #[doc = "Servo output 2 value"]
27629 pub servo2_raw: u16,
27630 #[doc = "Servo output 3 value"]
27631 pub servo3_raw: u16,
27632 #[doc = "Servo output 4 value"]
27633 pub servo4_raw: u16,
27634 #[doc = "Servo output 5 value"]
27635 pub servo5_raw: u16,
27636 #[doc = "Servo output 6 value"]
27637 pub servo6_raw: u16,
27638 #[doc = "Servo output 7 value"]
27639 pub servo7_raw: u16,
27640 #[doc = "Servo output 8 value"]
27641 pub servo8_raw: u16,
27642 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27643 pub port: u8,
27644 #[doc = "Servo output 9 value"]
27645 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27646 pub servo9_raw: u16,
27647 #[doc = "Servo output 10 value"]
27648 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27649 pub servo10_raw: u16,
27650 #[doc = "Servo output 11 value"]
27651 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27652 pub servo11_raw: u16,
27653 #[doc = "Servo output 12 value"]
27654 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27655 pub servo12_raw: u16,
27656 #[doc = "Servo output 13 value"]
27657 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27658 pub servo13_raw: u16,
27659 #[doc = "Servo output 14 value"]
27660 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27661 pub servo14_raw: u16,
27662 #[doc = "Servo output 15 value"]
27663 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27664 pub servo15_raw: u16,
27665 #[doc = "Servo output 16 value"]
27666 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27667 pub servo16_raw: u16,
27668}
27669impl SERVO_OUTPUT_RAW_DATA {
27670 pub const ENCODED_LEN: usize = 37usize;
27671 pub const DEFAULT: Self = Self {
27672 time_usec: 0_u32,
27673 servo1_raw: 0_u16,
27674 servo2_raw: 0_u16,
27675 servo3_raw: 0_u16,
27676 servo4_raw: 0_u16,
27677 servo5_raw: 0_u16,
27678 servo6_raw: 0_u16,
27679 servo7_raw: 0_u16,
27680 servo8_raw: 0_u16,
27681 port: 0_u8,
27682 servo9_raw: 0_u16,
27683 servo10_raw: 0_u16,
27684 servo11_raw: 0_u16,
27685 servo12_raw: 0_u16,
27686 servo13_raw: 0_u16,
27687 servo14_raw: 0_u16,
27688 servo15_raw: 0_u16,
27689 servo16_raw: 0_u16,
27690 };
27691 #[cfg(feature = "arbitrary")]
27692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27693 use arbitrary::{Arbitrary, Unstructured};
27694 let mut buf = [0u8; 1024];
27695 rng.fill_bytes(&mut buf);
27696 let mut unstructured = Unstructured::new(&buf);
27697 Self::arbitrary(&mut unstructured).unwrap_or_default()
27698 }
27699}
27700impl Default for SERVO_OUTPUT_RAW_DATA {
27701 fn default() -> Self {
27702 Self::DEFAULT.clone()
27703 }
27704}
27705impl MessageData for SERVO_OUTPUT_RAW_DATA {
27706 type Message = MavMessage;
27707 const ID: u32 = 36u32;
27708 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27709 const EXTRA_CRC: u8 = 222u8;
27710 const ENCODED_LEN: usize = 37usize;
27711 fn deser(
27712 _version: MavlinkVersion,
27713 __input: &[u8],
27714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27715 let avail_len = __input.len();
27716 let mut payload_buf = [0; Self::ENCODED_LEN];
27717 let mut buf = if avail_len < Self::ENCODED_LEN {
27718 payload_buf[0..avail_len].copy_from_slice(__input);
27719 Bytes::new(&payload_buf)
27720 } else {
27721 Bytes::new(__input)
27722 };
27723 let mut __struct = Self::default();
27724 __struct.time_usec = buf.get_u32_le();
27725 __struct.servo1_raw = buf.get_u16_le();
27726 __struct.servo2_raw = buf.get_u16_le();
27727 __struct.servo3_raw = buf.get_u16_le();
27728 __struct.servo4_raw = buf.get_u16_le();
27729 __struct.servo5_raw = buf.get_u16_le();
27730 __struct.servo6_raw = buf.get_u16_le();
27731 __struct.servo7_raw = buf.get_u16_le();
27732 __struct.servo8_raw = buf.get_u16_le();
27733 __struct.port = buf.get_u8();
27734 __struct.servo9_raw = buf.get_u16_le();
27735 __struct.servo10_raw = buf.get_u16_le();
27736 __struct.servo11_raw = buf.get_u16_le();
27737 __struct.servo12_raw = buf.get_u16_le();
27738 __struct.servo13_raw = buf.get_u16_le();
27739 __struct.servo14_raw = buf.get_u16_le();
27740 __struct.servo15_raw = buf.get_u16_le();
27741 __struct.servo16_raw = buf.get_u16_le();
27742 Ok(__struct)
27743 }
27744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27745 let mut __tmp = BytesMut::new(bytes);
27746 #[allow(clippy::absurd_extreme_comparisons)]
27747 #[allow(unused_comparisons)]
27748 if __tmp.remaining() < Self::ENCODED_LEN {
27749 panic!(
27750 "buffer is too small (need {} bytes, but got {})",
27751 Self::ENCODED_LEN,
27752 __tmp.remaining(),
27753 )
27754 }
27755 __tmp.put_u32_le(self.time_usec);
27756 __tmp.put_u16_le(self.servo1_raw);
27757 __tmp.put_u16_le(self.servo2_raw);
27758 __tmp.put_u16_le(self.servo3_raw);
27759 __tmp.put_u16_le(self.servo4_raw);
27760 __tmp.put_u16_le(self.servo5_raw);
27761 __tmp.put_u16_le(self.servo6_raw);
27762 __tmp.put_u16_le(self.servo7_raw);
27763 __tmp.put_u16_le(self.servo8_raw);
27764 __tmp.put_u8(self.port);
27765 if matches!(version, MavlinkVersion::V2) {
27766 __tmp.put_u16_le(self.servo9_raw);
27767 __tmp.put_u16_le(self.servo10_raw);
27768 __tmp.put_u16_le(self.servo11_raw);
27769 __tmp.put_u16_le(self.servo12_raw);
27770 __tmp.put_u16_le(self.servo13_raw);
27771 __tmp.put_u16_le(self.servo14_raw);
27772 __tmp.put_u16_le(self.servo15_raw);
27773 __tmp.put_u16_le(self.servo16_raw);
27774 let len = __tmp.len();
27775 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27776 } else {
27777 __tmp.len()
27778 }
27779 }
27780}
27781#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27782#[doc = ""]
27783#[doc = "ID: 256"]
27784#[derive(Debug, Clone, PartialEq)]
27785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27787#[cfg_attr(feature = "ts", derive(TS))]
27788#[cfg_attr(feature = "ts", ts(export))]
27789pub struct SETUP_SIGNING_DATA {
27790 #[doc = "initial timestamp"]
27791 pub initial_timestamp: u64,
27792 #[doc = "system id of the target"]
27793 pub target_system: u8,
27794 #[doc = "component ID of the target"]
27795 pub target_component: u8,
27796 #[doc = "signing key"]
27797 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27798 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27799 pub secret_key: [u8; 32],
27800}
27801impl SETUP_SIGNING_DATA {
27802 pub const ENCODED_LEN: usize = 42usize;
27803 pub const DEFAULT: Self = Self {
27804 initial_timestamp: 0_u64,
27805 target_system: 0_u8,
27806 target_component: 0_u8,
27807 secret_key: [0_u8; 32usize],
27808 };
27809 #[cfg(feature = "arbitrary")]
27810 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27811 use arbitrary::{Arbitrary, Unstructured};
27812 let mut buf = [0u8; 1024];
27813 rng.fill_bytes(&mut buf);
27814 let mut unstructured = Unstructured::new(&buf);
27815 Self::arbitrary(&mut unstructured).unwrap_or_default()
27816 }
27817}
27818impl Default for SETUP_SIGNING_DATA {
27819 fn default() -> Self {
27820 Self::DEFAULT.clone()
27821 }
27822}
27823impl MessageData for SETUP_SIGNING_DATA {
27824 type Message = MavMessage;
27825 const ID: u32 = 256u32;
27826 const NAME: &'static str = "SETUP_SIGNING";
27827 const EXTRA_CRC: u8 = 71u8;
27828 const ENCODED_LEN: usize = 42usize;
27829 fn deser(
27830 _version: MavlinkVersion,
27831 __input: &[u8],
27832 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27833 let avail_len = __input.len();
27834 let mut payload_buf = [0; Self::ENCODED_LEN];
27835 let mut buf = if avail_len < Self::ENCODED_LEN {
27836 payload_buf[0..avail_len].copy_from_slice(__input);
27837 Bytes::new(&payload_buf)
27838 } else {
27839 Bytes::new(__input)
27840 };
27841 let mut __struct = Self::default();
27842 __struct.initial_timestamp = buf.get_u64_le();
27843 __struct.target_system = buf.get_u8();
27844 __struct.target_component = buf.get_u8();
27845 for v in &mut __struct.secret_key {
27846 let val = buf.get_u8();
27847 *v = val;
27848 }
27849 Ok(__struct)
27850 }
27851 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27852 let mut __tmp = BytesMut::new(bytes);
27853 #[allow(clippy::absurd_extreme_comparisons)]
27854 #[allow(unused_comparisons)]
27855 if __tmp.remaining() < Self::ENCODED_LEN {
27856 panic!(
27857 "buffer is too small (need {} bytes, but got {})",
27858 Self::ENCODED_LEN,
27859 __tmp.remaining(),
27860 )
27861 }
27862 __tmp.put_u64_le(self.initial_timestamp);
27863 __tmp.put_u8(self.target_system);
27864 __tmp.put_u8(self.target_component);
27865 for val in &self.secret_key {
27866 __tmp.put_u8(*val);
27867 }
27868 if matches!(version, MavlinkVersion::V2) {
27869 let len = __tmp.len();
27870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27871 } else {
27872 __tmp.len()
27873 }
27874 }
27875}
27876#[doc = "Set the vehicle attitude and body angular rates."]
27877#[doc = ""]
27878#[doc = "ID: 139"]
27879#[derive(Debug, Clone, PartialEq)]
27880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27882#[cfg_attr(feature = "ts", derive(TS))]
27883#[cfg_attr(feature = "ts", ts(export))]
27884pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27885 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27886 pub time_usec: u64,
27887 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27888 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27889 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27890 pub controls: [f32; 8],
27891 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27892 pub group_mlx: u8,
27893 #[doc = "System ID"]
27894 pub target_system: u8,
27895 #[doc = "Component ID"]
27896 pub target_component: u8,
27897}
27898impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27899 pub const ENCODED_LEN: usize = 43usize;
27900 pub const DEFAULT: Self = Self {
27901 time_usec: 0_u64,
27902 controls: [0.0_f32; 8usize],
27903 group_mlx: 0_u8,
27904 target_system: 0_u8,
27905 target_component: 0_u8,
27906 };
27907 #[cfg(feature = "arbitrary")]
27908 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27909 use arbitrary::{Arbitrary, Unstructured};
27910 let mut buf = [0u8; 1024];
27911 rng.fill_bytes(&mut buf);
27912 let mut unstructured = Unstructured::new(&buf);
27913 Self::arbitrary(&mut unstructured).unwrap_or_default()
27914 }
27915}
27916impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27917 fn default() -> Self {
27918 Self::DEFAULT.clone()
27919 }
27920}
27921impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27922 type Message = MavMessage;
27923 const ID: u32 = 139u32;
27924 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27925 const EXTRA_CRC: u8 = 168u8;
27926 const ENCODED_LEN: usize = 43usize;
27927 fn deser(
27928 _version: MavlinkVersion,
27929 __input: &[u8],
27930 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27931 let avail_len = __input.len();
27932 let mut payload_buf = [0; Self::ENCODED_LEN];
27933 let mut buf = if avail_len < Self::ENCODED_LEN {
27934 payload_buf[0..avail_len].copy_from_slice(__input);
27935 Bytes::new(&payload_buf)
27936 } else {
27937 Bytes::new(__input)
27938 };
27939 let mut __struct = Self::default();
27940 __struct.time_usec = buf.get_u64_le();
27941 for v in &mut __struct.controls {
27942 let val = buf.get_f32_le();
27943 *v = val;
27944 }
27945 __struct.group_mlx = buf.get_u8();
27946 __struct.target_system = buf.get_u8();
27947 __struct.target_component = buf.get_u8();
27948 Ok(__struct)
27949 }
27950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27951 let mut __tmp = BytesMut::new(bytes);
27952 #[allow(clippy::absurd_extreme_comparisons)]
27953 #[allow(unused_comparisons)]
27954 if __tmp.remaining() < Self::ENCODED_LEN {
27955 panic!(
27956 "buffer is too small (need {} bytes, but got {})",
27957 Self::ENCODED_LEN,
27958 __tmp.remaining(),
27959 )
27960 }
27961 __tmp.put_u64_le(self.time_usec);
27962 for val in &self.controls {
27963 __tmp.put_f32_le(*val);
27964 }
27965 __tmp.put_u8(self.group_mlx);
27966 __tmp.put_u8(self.target_system);
27967 __tmp.put_u8(self.target_component);
27968 if matches!(version, MavlinkVersion::V2) {
27969 let len = __tmp.len();
27970 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27971 } else {
27972 __tmp.len()
27973 }
27974 }
27975}
27976#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27977#[doc = ""]
27978#[doc = "ID: 82"]
27979#[derive(Debug, Clone, PartialEq)]
27980#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27981#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27982#[cfg_attr(feature = "ts", derive(TS))]
27983#[cfg_attr(feature = "ts", ts(export))]
27984pub struct SET_ATTITUDE_TARGET_DATA {
27985 #[doc = "Timestamp (time since system boot)."]
27986 pub time_boot_ms: u32,
27987 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27988 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27989 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27990 pub q: [f32; 4],
27991 #[doc = "Body roll rate"]
27992 pub body_roll_rate: f32,
27993 #[doc = "Body pitch rate"]
27994 pub body_pitch_rate: f32,
27995 #[doc = "Body yaw rate"]
27996 pub body_yaw_rate: f32,
27997 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27998 pub thrust: f32,
27999 #[doc = "System ID"]
28000 pub target_system: u8,
28001 #[doc = "Component ID"]
28002 pub target_component: u8,
28003 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28004 pub type_mask: AttitudeTargetTypemask,
28005 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
28006 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28007 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28008 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28009 pub thrust_body: [f32; 3],
28010}
28011impl SET_ATTITUDE_TARGET_DATA {
28012 pub const ENCODED_LEN: usize = 51usize;
28013 pub const DEFAULT: Self = Self {
28014 time_boot_ms: 0_u32,
28015 q: [0.0_f32; 4usize],
28016 body_roll_rate: 0.0_f32,
28017 body_pitch_rate: 0.0_f32,
28018 body_yaw_rate: 0.0_f32,
28019 thrust: 0.0_f32,
28020 target_system: 0_u8,
28021 target_component: 0_u8,
28022 type_mask: AttitudeTargetTypemask::DEFAULT,
28023 thrust_body: [0.0_f32; 3usize],
28024 };
28025 #[cfg(feature = "arbitrary")]
28026 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28027 use arbitrary::{Arbitrary, Unstructured};
28028 let mut buf = [0u8; 1024];
28029 rng.fill_bytes(&mut buf);
28030 let mut unstructured = Unstructured::new(&buf);
28031 Self::arbitrary(&mut unstructured).unwrap_or_default()
28032 }
28033}
28034impl Default for SET_ATTITUDE_TARGET_DATA {
28035 fn default() -> Self {
28036 Self::DEFAULT.clone()
28037 }
28038}
28039impl MessageData for SET_ATTITUDE_TARGET_DATA {
28040 type Message = MavMessage;
28041 const ID: u32 = 82u32;
28042 const NAME: &'static str = "SET_ATTITUDE_TARGET";
28043 const EXTRA_CRC: u8 = 49u8;
28044 const ENCODED_LEN: usize = 51usize;
28045 fn deser(
28046 _version: MavlinkVersion,
28047 __input: &[u8],
28048 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28049 let avail_len = __input.len();
28050 let mut payload_buf = [0; Self::ENCODED_LEN];
28051 let mut buf = if avail_len < Self::ENCODED_LEN {
28052 payload_buf[0..avail_len].copy_from_slice(__input);
28053 Bytes::new(&payload_buf)
28054 } else {
28055 Bytes::new(__input)
28056 };
28057 let mut __struct = Self::default();
28058 __struct.time_boot_ms = buf.get_u32_le();
28059 for v in &mut __struct.q {
28060 let val = buf.get_f32_le();
28061 *v = val;
28062 }
28063 __struct.body_roll_rate = buf.get_f32_le();
28064 __struct.body_pitch_rate = buf.get_f32_le();
28065 __struct.body_yaw_rate = buf.get_f32_le();
28066 __struct.thrust = buf.get_f32_le();
28067 __struct.target_system = buf.get_u8();
28068 __struct.target_component = buf.get_u8();
28069 let tmp = buf.get_u8();
28070 __struct.type_mask = AttitudeTargetTypemask::from_bits(
28071 tmp & AttitudeTargetTypemask::all().bits(),
28072 )
28073 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28074 flag_type: "AttitudeTargetTypemask",
28075 value: tmp as u32,
28076 })?;
28077 for v in &mut __struct.thrust_body {
28078 let val = buf.get_f32_le();
28079 *v = val;
28080 }
28081 Ok(__struct)
28082 }
28083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28084 let mut __tmp = BytesMut::new(bytes);
28085 #[allow(clippy::absurd_extreme_comparisons)]
28086 #[allow(unused_comparisons)]
28087 if __tmp.remaining() < Self::ENCODED_LEN {
28088 panic!(
28089 "buffer is too small (need {} bytes, but got {})",
28090 Self::ENCODED_LEN,
28091 __tmp.remaining(),
28092 )
28093 }
28094 __tmp.put_u32_le(self.time_boot_ms);
28095 for val in &self.q {
28096 __tmp.put_f32_le(*val);
28097 }
28098 __tmp.put_f32_le(self.body_roll_rate);
28099 __tmp.put_f32_le(self.body_pitch_rate);
28100 __tmp.put_f32_le(self.body_yaw_rate);
28101 __tmp.put_f32_le(self.thrust);
28102 __tmp.put_u8(self.target_system);
28103 __tmp.put_u8(self.target_component);
28104 __tmp.put_u8(self.type_mask.bits());
28105 if matches!(version, MavlinkVersion::V2) {
28106 for val in &self.thrust_body {
28107 __tmp.put_f32_le(*val);
28108 }
28109 let len = __tmp.len();
28110 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28111 } else {
28112 __tmp.len()
28113 }
28114 }
28115}
28116#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
28117#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
28118#[doc = ""]
28119#[doc = "ID: 48"]
28120#[derive(Debug, Clone, PartialEq)]
28121#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28122#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28123#[cfg_attr(feature = "ts", derive(TS))]
28124#[cfg_attr(feature = "ts", ts(export))]
28125pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
28126 #[doc = "Latitude (WGS84)"]
28127 pub latitude: i32,
28128 #[doc = "Longitude (WGS84)"]
28129 pub longitude: i32,
28130 #[doc = "Altitude (MSL). Positive for up."]
28131 pub altitude: i32,
28132 #[doc = "System ID"]
28133 pub target_system: u8,
28134 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28135 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28136 pub time_usec: u64,
28137}
28138impl SET_GPS_GLOBAL_ORIGIN_DATA {
28139 pub const ENCODED_LEN: usize = 21usize;
28140 pub const DEFAULT: Self = Self {
28141 latitude: 0_i32,
28142 longitude: 0_i32,
28143 altitude: 0_i32,
28144 target_system: 0_u8,
28145 time_usec: 0_u64,
28146 };
28147 #[cfg(feature = "arbitrary")]
28148 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28149 use arbitrary::{Arbitrary, Unstructured};
28150 let mut buf = [0u8; 1024];
28151 rng.fill_bytes(&mut buf);
28152 let mut unstructured = Unstructured::new(&buf);
28153 Self::arbitrary(&mut unstructured).unwrap_or_default()
28154 }
28155}
28156impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28157 fn default() -> Self {
28158 Self::DEFAULT.clone()
28159 }
28160}
28161impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28162 type Message = MavMessage;
28163 const ID: u32 = 48u32;
28164 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28165 const EXTRA_CRC: u8 = 41u8;
28166 const ENCODED_LEN: usize = 21usize;
28167 fn deser(
28168 _version: MavlinkVersion,
28169 __input: &[u8],
28170 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28171 let avail_len = __input.len();
28172 let mut payload_buf = [0; Self::ENCODED_LEN];
28173 let mut buf = if avail_len < Self::ENCODED_LEN {
28174 payload_buf[0..avail_len].copy_from_slice(__input);
28175 Bytes::new(&payload_buf)
28176 } else {
28177 Bytes::new(__input)
28178 };
28179 let mut __struct = Self::default();
28180 __struct.latitude = buf.get_i32_le();
28181 __struct.longitude = buf.get_i32_le();
28182 __struct.altitude = buf.get_i32_le();
28183 __struct.target_system = buf.get_u8();
28184 __struct.time_usec = buf.get_u64_le();
28185 Ok(__struct)
28186 }
28187 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28188 let mut __tmp = BytesMut::new(bytes);
28189 #[allow(clippy::absurd_extreme_comparisons)]
28190 #[allow(unused_comparisons)]
28191 if __tmp.remaining() < Self::ENCODED_LEN {
28192 panic!(
28193 "buffer is too small (need {} bytes, but got {})",
28194 Self::ENCODED_LEN,
28195 __tmp.remaining(),
28196 )
28197 }
28198 __tmp.put_i32_le(self.latitude);
28199 __tmp.put_i32_le(self.longitude);
28200 __tmp.put_i32_le(self.altitude);
28201 __tmp.put_u8(self.target_system);
28202 if matches!(version, MavlinkVersion::V2) {
28203 __tmp.put_u64_le(self.time_usec);
28204 let len = __tmp.len();
28205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28206 } else {
28207 __tmp.len()
28208 }
28209 }
28210}
28211#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28212#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28213#[doc = ""]
28214#[doc = "ID: 243"]
28215#[derive(Debug, Clone, PartialEq)]
28216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28218#[cfg_attr(feature = "ts", derive(TS))]
28219#[cfg_attr(feature = "ts", ts(export))]
28220pub struct SET_HOME_POSITION_DATA {
28221 #[doc = "Latitude (WGS84)"]
28222 pub latitude: i32,
28223 #[doc = "Longitude (WGS84)"]
28224 pub longitude: i32,
28225 #[doc = "Altitude (MSL). Positive for up."]
28226 pub altitude: i32,
28227 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28228 pub x: f32,
28229 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28230 pub y: f32,
28231 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28232 pub z: f32,
28233 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28234 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28235 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28236 pub q: [f32; 4],
28237 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28238 pub approach_x: f32,
28239 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28240 pub approach_y: f32,
28241 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28242 pub approach_z: f32,
28243 #[doc = "System ID."]
28244 pub target_system: u8,
28245 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28246 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28247 pub time_usec: u64,
28248}
28249impl SET_HOME_POSITION_DATA {
28250 pub const ENCODED_LEN: usize = 61usize;
28251 pub const DEFAULT: Self = Self {
28252 latitude: 0_i32,
28253 longitude: 0_i32,
28254 altitude: 0_i32,
28255 x: 0.0_f32,
28256 y: 0.0_f32,
28257 z: 0.0_f32,
28258 q: [0.0_f32; 4usize],
28259 approach_x: 0.0_f32,
28260 approach_y: 0.0_f32,
28261 approach_z: 0.0_f32,
28262 target_system: 0_u8,
28263 time_usec: 0_u64,
28264 };
28265 #[cfg(feature = "arbitrary")]
28266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28267 use arbitrary::{Arbitrary, Unstructured};
28268 let mut buf = [0u8; 1024];
28269 rng.fill_bytes(&mut buf);
28270 let mut unstructured = Unstructured::new(&buf);
28271 Self::arbitrary(&mut unstructured).unwrap_or_default()
28272 }
28273}
28274impl Default for SET_HOME_POSITION_DATA {
28275 fn default() -> Self {
28276 Self::DEFAULT.clone()
28277 }
28278}
28279impl MessageData for SET_HOME_POSITION_DATA {
28280 type Message = MavMessage;
28281 const ID: u32 = 243u32;
28282 const NAME: &'static str = "SET_HOME_POSITION";
28283 const EXTRA_CRC: u8 = 85u8;
28284 const ENCODED_LEN: usize = 61usize;
28285 fn deser(
28286 _version: MavlinkVersion,
28287 __input: &[u8],
28288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28289 let avail_len = __input.len();
28290 let mut payload_buf = [0; Self::ENCODED_LEN];
28291 let mut buf = if avail_len < Self::ENCODED_LEN {
28292 payload_buf[0..avail_len].copy_from_slice(__input);
28293 Bytes::new(&payload_buf)
28294 } else {
28295 Bytes::new(__input)
28296 };
28297 let mut __struct = Self::default();
28298 __struct.latitude = buf.get_i32_le();
28299 __struct.longitude = buf.get_i32_le();
28300 __struct.altitude = buf.get_i32_le();
28301 __struct.x = buf.get_f32_le();
28302 __struct.y = buf.get_f32_le();
28303 __struct.z = buf.get_f32_le();
28304 for v in &mut __struct.q {
28305 let val = buf.get_f32_le();
28306 *v = val;
28307 }
28308 __struct.approach_x = buf.get_f32_le();
28309 __struct.approach_y = buf.get_f32_le();
28310 __struct.approach_z = buf.get_f32_le();
28311 __struct.target_system = buf.get_u8();
28312 __struct.time_usec = buf.get_u64_le();
28313 Ok(__struct)
28314 }
28315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28316 let mut __tmp = BytesMut::new(bytes);
28317 #[allow(clippy::absurd_extreme_comparisons)]
28318 #[allow(unused_comparisons)]
28319 if __tmp.remaining() < Self::ENCODED_LEN {
28320 panic!(
28321 "buffer is too small (need {} bytes, but got {})",
28322 Self::ENCODED_LEN,
28323 __tmp.remaining(),
28324 )
28325 }
28326 __tmp.put_i32_le(self.latitude);
28327 __tmp.put_i32_le(self.longitude);
28328 __tmp.put_i32_le(self.altitude);
28329 __tmp.put_f32_le(self.x);
28330 __tmp.put_f32_le(self.y);
28331 __tmp.put_f32_le(self.z);
28332 for val in &self.q {
28333 __tmp.put_f32_le(*val);
28334 }
28335 __tmp.put_f32_le(self.approach_x);
28336 __tmp.put_f32_le(self.approach_y);
28337 __tmp.put_f32_le(self.approach_z);
28338 __tmp.put_u8(self.target_system);
28339 if matches!(version, MavlinkVersion::V2) {
28340 __tmp.put_u64_le(self.time_usec);
28341 let len = __tmp.len();
28342 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28343 } else {
28344 __tmp.len()
28345 }
28346 }
28347}
28348#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28349#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28350#[doc = ""]
28351#[doc = "ID: 11"]
28352#[derive(Debug, Clone, PartialEq)]
28353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28355#[cfg_attr(feature = "ts", derive(TS))]
28356#[cfg_attr(feature = "ts", ts(export))]
28357pub struct SET_MODE_DATA {
28358 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28359 pub custom_mode: u32,
28360 #[doc = "The system setting the mode"]
28361 pub target_system: u8,
28362 #[doc = "The new base mode."]
28363 pub base_mode: MavMode,
28364}
28365impl SET_MODE_DATA {
28366 pub const ENCODED_LEN: usize = 6usize;
28367 pub const DEFAULT: Self = Self {
28368 custom_mode: 0_u32,
28369 target_system: 0_u8,
28370 base_mode: MavMode::DEFAULT,
28371 };
28372 #[cfg(feature = "arbitrary")]
28373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28374 use arbitrary::{Arbitrary, Unstructured};
28375 let mut buf = [0u8; 1024];
28376 rng.fill_bytes(&mut buf);
28377 let mut unstructured = Unstructured::new(&buf);
28378 Self::arbitrary(&mut unstructured).unwrap_or_default()
28379 }
28380}
28381impl Default for SET_MODE_DATA {
28382 fn default() -> Self {
28383 Self::DEFAULT.clone()
28384 }
28385}
28386impl MessageData for SET_MODE_DATA {
28387 type Message = MavMessage;
28388 const ID: u32 = 11u32;
28389 const NAME: &'static str = "SET_MODE";
28390 const EXTRA_CRC: u8 = 89u8;
28391 const ENCODED_LEN: usize = 6usize;
28392 fn deser(
28393 _version: MavlinkVersion,
28394 __input: &[u8],
28395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28396 let avail_len = __input.len();
28397 let mut payload_buf = [0; Self::ENCODED_LEN];
28398 let mut buf = if avail_len < Self::ENCODED_LEN {
28399 payload_buf[0..avail_len].copy_from_slice(__input);
28400 Bytes::new(&payload_buf)
28401 } else {
28402 Bytes::new(__input)
28403 };
28404 let mut __struct = Self::default();
28405 __struct.custom_mode = buf.get_u32_le();
28406 __struct.target_system = buf.get_u8();
28407 let tmp = buf.get_u8();
28408 __struct.base_mode =
28409 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28410 enum_type: "MavMode",
28411 value: tmp as u32,
28412 })?;
28413 Ok(__struct)
28414 }
28415 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28416 let mut __tmp = BytesMut::new(bytes);
28417 #[allow(clippy::absurd_extreme_comparisons)]
28418 #[allow(unused_comparisons)]
28419 if __tmp.remaining() < Self::ENCODED_LEN {
28420 panic!(
28421 "buffer is too small (need {} bytes, but got {})",
28422 Self::ENCODED_LEN,
28423 __tmp.remaining(),
28424 )
28425 }
28426 __tmp.put_u32_le(self.custom_mode);
28427 __tmp.put_u8(self.target_system);
28428 __tmp.put_u8(self.base_mode as u8);
28429 if matches!(version, MavlinkVersion::V2) {
28430 let len = __tmp.len();
28431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28432 } else {
28433 __tmp.len()
28434 }
28435 }
28436}
28437#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28438#[doc = ""]
28439#[doc = "ID: 86"]
28440#[derive(Debug, Clone, PartialEq)]
28441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28442#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28443#[cfg_attr(feature = "ts", derive(TS))]
28444#[cfg_attr(feature = "ts", ts(export))]
28445pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28446 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28447 pub time_boot_ms: u32,
28448 #[doc = "Latitude in WGS84 frame"]
28449 pub lat_int: i32,
28450 #[doc = "Longitude in WGS84 frame"]
28451 pub lon_int: i32,
28452 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28453 pub alt: f32,
28454 #[doc = "X velocity in NED frame"]
28455 pub vx: f32,
28456 #[doc = "Y velocity in NED frame"]
28457 pub vy: f32,
28458 #[doc = "Z velocity in NED frame"]
28459 pub vz: f32,
28460 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28461 pub afx: f32,
28462 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28463 pub afy: f32,
28464 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28465 pub afz: f32,
28466 #[doc = "yaw setpoint"]
28467 pub yaw: f32,
28468 #[doc = "yaw rate setpoint"]
28469 pub yaw_rate: f32,
28470 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28471 pub type_mask: PositionTargetTypemask,
28472 #[doc = "System ID"]
28473 pub target_system: u8,
28474 #[doc = "Component ID"]
28475 pub target_component: u8,
28476 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28477 pub coordinate_frame: MavFrame,
28478}
28479impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28480 pub const ENCODED_LEN: usize = 53usize;
28481 pub const DEFAULT: Self = Self {
28482 time_boot_ms: 0_u32,
28483 lat_int: 0_i32,
28484 lon_int: 0_i32,
28485 alt: 0.0_f32,
28486 vx: 0.0_f32,
28487 vy: 0.0_f32,
28488 vz: 0.0_f32,
28489 afx: 0.0_f32,
28490 afy: 0.0_f32,
28491 afz: 0.0_f32,
28492 yaw: 0.0_f32,
28493 yaw_rate: 0.0_f32,
28494 type_mask: PositionTargetTypemask::DEFAULT,
28495 target_system: 0_u8,
28496 target_component: 0_u8,
28497 coordinate_frame: MavFrame::DEFAULT,
28498 };
28499 #[cfg(feature = "arbitrary")]
28500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28501 use arbitrary::{Arbitrary, Unstructured};
28502 let mut buf = [0u8; 1024];
28503 rng.fill_bytes(&mut buf);
28504 let mut unstructured = Unstructured::new(&buf);
28505 Self::arbitrary(&mut unstructured).unwrap_or_default()
28506 }
28507}
28508impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28509 fn default() -> Self {
28510 Self::DEFAULT.clone()
28511 }
28512}
28513impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28514 type Message = MavMessage;
28515 const ID: u32 = 86u32;
28516 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28517 const EXTRA_CRC: u8 = 5u8;
28518 const ENCODED_LEN: usize = 53usize;
28519 fn deser(
28520 _version: MavlinkVersion,
28521 __input: &[u8],
28522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28523 let avail_len = __input.len();
28524 let mut payload_buf = [0; Self::ENCODED_LEN];
28525 let mut buf = if avail_len < Self::ENCODED_LEN {
28526 payload_buf[0..avail_len].copy_from_slice(__input);
28527 Bytes::new(&payload_buf)
28528 } else {
28529 Bytes::new(__input)
28530 };
28531 let mut __struct = Self::default();
28532 __struct.time_boot_ms = buf.get_u32_le();
28533 __struct.lat_int = buf.get_i32_le();
28534 __struct.lon_int = buf.get_i32_le();
28535 __struct.alt = buf.get_f32_le();
28536 __struct.vx = buf.get_f32_le();
28537 __struct.vy = buf.get_f32_le();
28538 __struct.vz = buf.get_f32_le();
28539 __struct.afx = buf.get_f32_le();
28540 __struct.afy = buf.get_f32_le();
28541 __struct.afz = buf.get_f32_le();
28542 __struct.yaw = buf.get_f32_le();
28543 __struct.yaw_rate = buf.get_f32_le();
28544 let tmp = buf.get_u16_le();
28545 __struct.type_mask = PositionTargetTypemask::from_bits(
28546 tmp & PositionTargetTypemask::all().bits(),
28547 )
28548 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28549 flag_type: "PositionTargetTypemask",
28550 value: tmp as u32,
28551 })?;
28552 __struct.target_system = buf.get_u8();
28553 __struct.target_component = buf.get_u8();
28554 let tmp = buf.get_u8();
28555 __struct.coordinate_frame =
28556 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28557 enum_type: "MavFrame",
28558 value: tmp as u32,
28559 })?;
28560 Ok(__struct)
28561 }
28562 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28563 let mut __tmp = BytesMut::new(bytes);
28564 #[allow(clippy::absurd_extreme_comparisons)]
28565 #[allow(unused_comparisons)]
28566 if __tmp.remaining() < Self::ENCODED_LEN {
28567 panic!(
28568 "buffer is too small (need {} bytes, but got {})",
28569 Self::ENCODED_LEN,
28570 __tmp.remaining(),
28571 )
28572 }
28573 __tmp.put_u32_le(self.time_boot_ms);
28574 __tmp.put_i32_le(self.lat_int);
28575 __tmp.put_i32_le(self.lon_int);
28576 __tmp.put_f32_le(self.alt);
28577 __tmp.put_f32_le(self.vx);
28578 __tmp.put_f32_le(self.vy);
28579 __tmp.put_f32_le(self.vz);
28580 __tmp.put_f32_le(self.afx);
28581 __tmp.put_f32_le(self.afy);
28582 __tmp.put_f32_le(self.afz);
28583 __tmp.put_f32_le(self.yaw);
28584 __tmp.put_f32_le(self.yaw_rate);
28585 __tmp.put_u16_le(self.type_mask.bits());
28586 __tmp.put_u8(self.target_system);
28587 __tmp.put_u8(self.target_component);
28588 __tmp.put_u8(self.coordinate_frame as u8);
28589 if matches!(version, MavlinkVersion::V2) {
28590 let len = __tmp.len();
28591 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28592 } else {
28593 __tmp.len()
28594 }
28595 }
28596}
28597#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28598#[doc = ""]
28599#[doc = "ID: 84"]
28600#[derive(Debug, Clone, PartialEq)]
28601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28603#[cfg_attr(feature = "ts", derive(TS))]
28604#[cfg_attr(feature = "ts", ts(export))]
28605pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28606 #[doc = "Timestamp (time since system boot)."]
28607 pub time_boot_ms: u32,
28608 #[doc = "X Position in NED frame"]
28609 pub x: f32,
28610 #[doc = "Y Position in NED frame"]
28611 pub y: f32,
28612 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28613 pub z: f32,
28614 #[doc = "X velocity in NED frame"]
28615 pub vx: f32,
28616 #[doc = "Y velocity in NED frame"]
28617 pub vy: f32,
28618 #[doc = "Z velocity in NED frame"]
28619 pub vz: f32,
28620 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28621 pub afx: f32,
28622 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28623 pub afy: f32,
28624 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28625 pub afz: f32,
28626 #[doc = "yaw setpoint"]
28627 pub yaw: f32,
28628 #[doc = "yaw rate setpoint"]
28629 pub yaw_rate: f32,
28630 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28631 pub type_mask: PositionTargetTypemask,
28632 #[doc = "System ID"]
28633 pub target_system: u8,
28634 #[doc = "Component ID"]
28635 pub target_component: u8,
28636 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28637 pub coordinate_frame: MavFrame,
28638}
28639impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28640 pub const ENCODED_LEN: usize = 53usize;
28641 pub const DEFAULT: Self = Self {
28642 time_boot_ms: 0_u32,
28643 x: 0.0_f32,
28644 y: 0.0_f32,
28645 z: 0.0_f32,
28646 vx: 0.0_f32,
28647 vy: 0.0_f32,
28648 vz: 0.0_f32,
28649 afx: 0.0_f32,
28650 afy: 0.0_f32,
28651 afz: 0.0_f32,
28652 yaw: 0.0_f32,
28653 yaw_rate: 0.0_f32,
28654 type_mask: PositionTargetTypemask::DEFAULT,
28655 target_system: 0_u8,
28656 target_component: 0_u8,
28657 coordinate_frame: MavFrame::DEFAULT,
28658 };
28659 #[cfg(feature = "arbitrary")]
28660 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28661 use arbitrary::{Arbitrary, Unstructured};
28662 let mut buf = [0u8; 1024];
28663 rng.fill_bytes(&mut buf);
28664 let mut unstructured = Unstructured::new(&buf);
28665 Self::arbitrary(&mut unstructured).unwrap_or_default()
28666 }
28667}
28668impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28669 fn default() -> Self {
28670 Self::DEFAULT.clone()
28671 }
28672}
28673impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28674 type Message = MavMessage;
28675 const ID: u32 = 84u32;
28676 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28677 const EXTRA_CRC: u8 = 143u8;
28678 const ENCODED_LEN: usize = 53usize;
28679 fn deser(
28680 _version: MavlinkVersion,
28681 __input: &[u8],
28682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28683 let avail_len = __input.len();
28684 let mut payload_buf = [0; Self::ENCODED_LEN];
28685 let mut buf = if avail_len < Self::ENCODED_LEN {
28686 payload_buf[0..avail_len].copy_from_slice(__input);
28687 Bytes::new(&payload_buf)
28688 } else {
28689 Bytes::new(__input)
28690 };
28691 let mut __struct = Self::default();
28692 __struct.time_boot_ms = buf.get_u32_le();
28693 __struct.x = buf.get_f32_le();
28694 __struct.y = buf.get_f32_le();
28695 __struct.z = buf.get_f32_le();
28696 __struct.vx = buf.get_f32_le();
28697 __struct.vy = buf.get_f32_le();
28698 __struct.vz = buf.get_f32_le();
28699 __struct.afx = buf.get_f32_le();
28700 __struct.afy = buf.get_f32_le();
28701 __struct.afz = buf.get_f32_le();
28702 __struct.yaw = buf.get_f32_le();
28703 __struct.yaw_rate = buf.get_f32_le();
28704 let tmp = buf.get_u16_le();
28705 __struct.type_mask = PositionTargetTypemask::from_bits(
28706 tmp & PositionTargetTypemask::all().bits(),
28707 )
28708 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28709 flag_type: "PositionTargetTypemask",
28710 value: tmp as u32,
28711 })?;
28712 __struct.target_system = buf.get_u8();
28713 __struct.target_component = buf.get_u8();
28714 let tmp = buf.get_u8();
28715 __struct.coordinate_frame =
28716 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28717 enum_type: "MavFrame",
28718 value: tmp as u32,
28719 })?;
28720 Ok(__struct)
28721 }
28722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28723 let mut __tmp = BytesMut::new(bytes);
28724 #[allow(clippy::absurd_extreme_comparisons)]
28725 #[allow(unused_comparisons)]
28726 if __tmp.remaining() < Self::ENCODED_LEN {
28727 panic!(
28728 "buffer is too small (need {} bytes, but got {})",
28729 Self::ENCODED_LEN,
28730 __tmp.remaining(),
28731 )
28732 }
28733 __tmp.put_u32_le(self.time_boot_ms);
28734 __tmp.put_f32_le(self.x);
28735 __tmp.put_f32_le(self.y);
28736 __tmp.put_f32_le(self.z);
28737 __tmp.put_f32_le(self.vx);
28738 __tmp.put_f32_le(self.vy);
28739 __tmp.put_f32_le(self.vz);
28740 __tmp.put_f32_le(self.afx);
28741 __tmp.put_f32_le(self.afy);
28742 __tmp.put_f32_le(self.afz);
28743 __tmp.put_f32_le(self.yaw);
28744 __tmp.put_f32_le(self.yaw_rate);
28745 __tmp.put_u16_le(self.type_mask.bits());
28746 __tmp.put_u8(self.target_system);
28747 __tmp.put_u8(self.target_component);
28748 __tmp.put_u8(self.coordinate_frame as u8);
28749 if matches!(version, MavlinkVersion::V2) {
28750 let len = __tmp.len();
28751 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28752 } else {
28753 __tmp.len()
28754 }
28755 }
28756}
28757#[doc = "Status of simulation environment, if used."]
28758#[doc = ""]
28759#[doc = "ID: 108"]
28760#[derive(Debug, Clone, PartialEq)]
28761#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28763#[cfg_attr(feature = "ts", derive(TS))]
28764#[cfg_attr(feature = "ts", ts(export))]
28765pub struct SIM_STATE_DATA {
28766 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28767 pub q1: f32,
28768 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28769 pub q2: f32,
28770 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28771 pub q3: f32,
28772 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28773 pub q4: f32,
28774 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28775 pub roll: f32,
28776 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28777 pub pitch: f32,
28778 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28779 pub yaw: f32,
28780 #[doc = "X acceleration"]
28781 pub xacc: f32,
28782 #[doc = "Y acceleration"]
28783 pub yacc: f32,
28784 #[doc = "Z acceleration"]
28785 pub zacc: f32,
28786 #[doc = "Angular speed around X axis"]
28787 pub xgyro: f32,
28788 #[doc = "Angular speed around Y axis"]
28789 pub ygyro: f32,
28790 #[doc = "Angular speed around Z axis"]
28791 pub zgyro: f32,
28792 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28793 pub lat: f32,
28794 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28795 pub lon: f32,
28796 #[doc = "Altitude"]
28797 pub alt: f32,
28798 #[doc = "Horizontal position standard deviation"]
28799 pub std_dev_horz: f32,
28800 #[doc = "Vertical position standard deviation"]
28801 pub std_dev_vert: f32,
28802 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28803 pub vn: f32,
28804 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28805 pub ve: f32,
28806 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28807 pub vd: f32,
28808 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28809 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28810 pub lat_int: i32,
28811 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28812 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28813 pub lon_int: i32,
28814}
28815impl SIM_STATE_DATA {
28816 pub const ENCODED_LEN: usize = 92usize;
28817 pub const DEFAULT: Self = Self {
28818 q1: 0.0_f32,
28819 q2: 0.0_f32,
28820 q3: 0.0_f32,
28821 q4: 0.0_f32,
28822 roll: 0.0_f32,
28823 pitch: 0.0_f32,
28824 yaw: 0.0_f32,
28825 xacc: 0.0_f32,
28826 yacc: 0.0_f32,
28827 zacc: 0.0_f32,
28828 xgyro: 0.0_f32,
28829 ygyro: 0.0_f32,
28830 zgyro: 0.0_f32,
28831 lat: 0.0_f32,
28832 lon: 0.0_f32,
28833 alt: 0.0_f32,
28834 std_dev_horz: 0.0_f32,
28835 std_dev_vert: 0.0_f32,
28836 vn: 0.0_f32,
28837 ve: 0.0_f32,
28838 vd: 0.0_f32,
28839 lat_int: 0_i32,
28840 lon_int: 0_i32,
28841 };
28842 #[cfg(feature = "arbitrary")]
28843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28844 use arbitrary::{Arbitrary, Unstructured};
28845 let mut buf = [0u8; 1024];
28846 rng.fill_bytes(&mut buf);
28847 let mut unstructured = Unstructured::new(&buf);
28848 Self::arbitrary(&mut unstructured).unwrap_or_default()
28849 }
28850}
28851impl Default for SIM_STATE_DATA {
28852 fn default() -> Self {
28853 Self::DEFAULT.clone()
28854 }
28855}
28856impl MessageData for SIM_STATE_DATA {
28857 type Message = MavMessage;
28858 const ID: u32 = 108u32;
28859 const NAME: &'static str = "SIM_STATE";
28860 const EXTRA_CRC: u8 = 32u8;
28861 const ENCODED_LEN: usize = 92usize;
28862 fn deser(
28863 _version: MavlinkVersion,
28864 __input: &[u8],
28865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28866 let avail_len = __input.len();
28867 let mut payload_buf = [0; Self::ENCODED_LEN];
28868 let mut buf = if avail_len < Self::ENCODED_LEN {
28869 payload_buf[0..avail_len].copy_from_slice(__input);
28870 Bytes::new(&payload_buf)
28871 } else {
28872 Bytes::new(__input)
28873 };
28874 let mut __struct = Self::default();
28875 __struct.q1 = buf.get_f32_le();
28876 __struct.q2 = buf.get_f32_le();
28877 __struct.q3 = buf.get_f32_le();
28878 __struct.q4 = buf.get_f32_le();
28879 __struct.roll = buf.get_f32_le();
28880 __struct.pitch = buf.get_f32_le();
28881 __struct.yaw = buf.get_f32_le();
28882 __struct.xacc = buf.get_f32_le();
28883 __struct.yacc = buf.get_f32_le();
28884 __struct.zacc = buf.get_f32_le();
28885 __struct.xgyro = buf.get_f32_le();
28886 __struct.ygyro = buf.get_f32_le();
28887 __struct.zgyro = buf.get_f32_le();
28888 __struct.lat = buf.get_f32_le();
28889 __struct.lon = buf.get_f32_le();
28890 __struct.alt = buf.get_f32_le();
28891 __struct.std_dev_horz = buf.get_f32_le();
28892 __struct.std_dev_vert = buf.get_f32_le();
28893 __struct.vn = buf.get_f32_le();
28894 __struct.ve = buf.get_f32_le();
28895 __struct.vd = buf.get_f32_le();
28896 __struct.lat_int = buf.get_i32_le();
28897 __struct.lon_int = buf.get_i32_le();
28898 Ok(__struct)
28899 }
28900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28901 let mut __tmp = BytesMut::new(bytes);
28902 #[allow(clippy::absurd_extreme_comparisons)]
28903 #[allow(unused_comparisons)]
28904 if __tmp.remaining() < Self::ENCODED_LEN {
28905 panic!(
28906 "buffer is too small (need {} bytes, but got {})",
28907 Self::ENCODED_LEN,
28908 __tmp.remaining(),
28909 )
28910 }
28911 __tmp.put_f32_le(self.q1);
28912 __tmp.put_f32_le(self.q2);
28913 __tmp.put_f32_le(self.q3);
28914 __tmp.put_f32_le(self.q4);
28915 __tmp.put_f32_le(self.roll);
28916 __tmp.put_f32_le(self.pitch);
28917 __tmp.put_f32_le(self.yaw);
28918 __tmp.put_f32_le(self.xacc);
28919 __tmp.put_f32_le(self.yacc);
28920 __tmp.put_f32_le(self.zacc);
28921 __tmp.put_f32_le(self.xgyro);
28922 __tmp.put_f32_le(self.ygyro);
28923 __tmp.put_f32_le(self.zgyro);
28924 __tmp.put_f32_le(self.lat);
28925 __tmp.put_f32_le(self.lon);
28926 __tmp.put_f32_le(self.alt);
28927 __tmp.put_f32_le(self.std_dev_horz);
28928 __tmp.put_f32_le(self.std_dev_vert);
28929 __tmp.put_f32_le(self.vn);
28930 __tmp.put_f32_le(self.ve);
28931 __tmp.put_f32_le(self.vd);
28932 if matches!(version, MavlinkVersion::V2) {
28933 __tmp.put_i32_le(self.lat_int);
28934 __tmp.put_i32_le(self.lon_int);
28935 let len = __tmp.len();
28936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28937 } else {
28938 __tmp.len()
28939 }
28940 }
28941}
28942#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28943#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28944#[doc = ""]
28945#[doc = "ID: 370"]
28946#[derive(Debug, Clone, PartialEq)]
28947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28949#[cfg_attr(feature = "ts", derive(TS))]
28950#[cfg_attr(feature = "ts", ts(export))]
28951pub struct SMART_BATTERY_INFO_DATA {
28952 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28953 pub capacity_full_specification: i32,
28954 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28955 pub capacity_full: i32,
28956 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28957 pub cycle_count: u16,
28958 #[doc = "Battery weight. 0: field not provided."]
28959 pub weight: u16,
28960 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28961 pub discharge_minimum_voltage: u16,
28962 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28963 pub charging_minimum_voltage: u16,
28964 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28965 pub resting_minimum_voltage: u16,
28966 #[doc = "Battery ID"]
28967 pub id: u8,
28968 #[doc = "Function of the battery"]
28969 pub battery_function: MavBatteryFunction,
28970 #[doc = "Type (chemistry) of the battery"]
28971 pub mavtype: MavBatteryType,
28972 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28973 #[cfg_attr(feature = "ts", ts(type = "string"))]
28974 pub serial_number: CharArray<16>,
28975 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28976 #[cfg_attr(feature = "ts", ts(type = "string"))]
28977 pub device_name: CharArray<50>,
28978 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28980 pub charging_maximum_voltage: u16,
28981 #[doc = "Number of battery cells in series. 0: field not provided."]
28982 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28983 pub cells_in_series: u8,
28984 #[doc = "Maximum pack discharge current. 0: field not provided."]
28985 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28986 pub discharge_maximum_current: u32,
28987 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28988 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28989 pub discharge_maximum_burst_current: u32,
28990 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28991 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28992 #[cfg_attr(feature = "ts", ts(type = "string"))]
28993 pub manufacture_date: CharArray<11>,
28994}
28995impl SMART_BATTERY_INFO_DATA {
28996 pub const ENCODED_LEN: usize = 109usize;
28997 pub const DEFAULT: Self = Self {
28998 capacity_full_specification: 0_i32,
28999 capacity_full: 0_i32,
29000 cycle_count: 0_u16,
29001 weight: 0_u16,
29002 discharge_minimum_voltage: 0_u16,
29003 charging_minimum_voltage: 0_u16,
29004 resting_minimum_voltage: 0_u16,
29005 id: 0_u8,
29006 battery_function: MavBatteryFunction::DEFAULT,
29007 mavtype: MavBatteryType::DEFAULT,
29008 serial_number: CharArray::new([0_u8; 16usize]),
29009 device_name: CharArray::new([0_u8; 50usize]),
29010 charging_maximum_voltage: 0_u16,
29011 cells_in_series: 0_u8,
29012 discharge_maximum_current: 0_u32,
29013 discharge_maximum_burst_current: 0_u32,
29014 manufacture_date: CharArray::new([0_u8; 11usize]),
29015 };
29016 #[cfg(feature = "arbitrary")]
29017 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29018 use arbitrary::{Arbitrary, Unstructured};
29019 let mut buf = [0u8; 1024];
29020 rng.fill_bytes(&mut buf);
29021 let mut unstructured = Unstructured::new(&buf);
29022 Self::arbitrary(&mut unstructured).unwrap_or_default()
29023 }
29024}
29025impl Default for SMART_BATTERY_INFO_DATA {
29026 fn default() -> Self {
29027 Self::DEFAULT.clone()
29028 }
29029}
29030impl MessageData for SMART_BATTERY_INFO_DATA {
29031 type Message = MavMessage;
29032 const ID: u32 = 370u32;
29033 const NAME: &'static str = "SMART_BATTERY_INFO";
29034 const EXTRA_CRC: u8 = 75u8;
29035 const ENCODED_LEN: usize = 109usize;
29036 fn deser(
29037 _version: MavlinkVersion,
29038 __input: &[u8],
29039 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29040 let avail_len = __input.len();
29041 let mut payload_buf = [0; Self::ENCODED_LEN];
29042 let mut buf = if avail_len < Self::ENCODED_LEN {
29043 payload_buf[0..avail_len].copy_from_slice(__input);
29044 Bytes::new(&payload_buf)
29045 } else {
29046 Bytes::new(__input)
29047 };
29048 let mut __struct = Self::default();
29049 __struct.capacity_full_specification = buf.get_i32_le();
29050 __struct.capacity_full = buf.get_i32_le();
29051 __struct.cycle_count = buf.get_u16_le();
29052 __struct.weight = buf.get_u16_le();
29053 __struct.discharge_minimum_voltage = buf.get_u16_le();
29054 __struct.charging_minimum_voltage = buf.get_u16_le();
29055 __struct.resting_minimum_voltage = buf.get_u16_le();
29056 __struct.id = buf.get_u8();
29057 let tmp = buf.get_u8();
29058 __struct.battery_function =
29059 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29060 enum_type: "MavBatteryFunction",
29061 value: tmp as u32,
29062 })?;
29063 let tmp = buf.get_u8();
29064 __struct.mavtype =
29065 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29066 enum_type: "MavBatteryType",
29067 value: tmp as u32,
29068 })?;
29069 let mut tmp = [0_u8; 16usize];
29070 for v in &mut tmp {
29071 *v = buf.get_u8();
29072 }
29073 __struct.serial_number = CharArray::new(tmp);
29074 let mut tmp = [0_u8; 50usize];
29075 for v in &mut tmp {
29076 *v = buf.get_u8();
29077 }
29078 __struct.device_name = CharArray::new(tmp);
29079 __struct.charging_maximum_voltage = buf.get_u16_le();
29080 __struct.cells_in_series = buf.get_u8();
29081 __struct.discharge_maximum_current = buf.get_u32_le();
29082 __struct.discharge_maximum_burst_current = buf.get_u32_le();
29083 let mut tmp = [0_u8; 11usize];
29084 for v in &mut tmp {
29085 *v = buf.get_u8();
29086 }
29087 __struct.manufacture_date = CharArray::new(tmp);
29088 Ok(__struct)
29089 }
29090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29091 let mut __tmp = BytesMut::new(bytes);
29092 #[allow(clippy::absurd_extreme_comparisons)]
29093 #[allow(unused_comparisons)]
29094 if __tmp.remaining() < Self::ENCODED_LEN {
29095 panic!(
29096 "buffer is too small (need {} bytes, but got {})",
29097 Self::ENCODED_LEN,
29098 __tmp.remaining(),
29099 )
29100 }
29101 __tmp.put_i32_le(self.capacity_full_specification);
29102 __tmp.put_i32_le(self.capacity_full);
29103 __tmp.put_u16_le(self.cycle_count);
29104 __tmp.put_u16_le(self.weight);
29105 __tmp.put_u16_le(self.discharge_minimum_voltage);
29106 __tmp.put_u16_le(self.charging_minimum_voltage);
29107 __tmp.put_u16_le(self.resting_minimum_voltage);
29108 __tmp.put_u8(self.id);
29109 __tmp.put_u8(self.battery_function as u8);
29110 __tmp.put_u8(self.mavtype as u8);
29111 for val in &self.serial_number {
29112 __tmp.put_u8(*val);
29113 }
29114 for val in &self.device_name {
29115 __tmp.put_u8(*val);
29116 }
29117 if matches!(version, MavlinkVersion::V2) {
29118 __tmp.put_u16_le(self.charging_maximum_voltage);
29119 __tmp.put_u8(self.cells_in_series);
29120 __tmp.put_u32_le(self.discharge_maximum_current);
29121 __tmp.put_u32_le(self.discharge_maximum_burst_current);
29122 for val in &self.manufacture_date {
29123 __tmp.put_u8(*val);
29124 }
29125 let len = __tmp.len();
29126 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29127 } else {
29128 __tmp.len()
29129 }
29130 }
29131}
29132#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
29133#[doc = ""]
29134#[doc = "ID: 253"]
29135#[derive(Debug, Clone, PartialEq)]
29136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29138#[cfg_attr(feature = "ts", derive(TS))]
29139#[cfg_attr(feature = "ts", ts(export))]
29140pub struct STATUSTEXT_DATA {
29141 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
29142 pub severity: MavSeverity,
29143 #[doc = "Status text message, without null termination character"]
29144 #[cfg_attr(feature = "ts", ts(type = "string"))]
29145 pub text: CharArray<50>,
29146 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
29147 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29148 pub id: u16,
29149 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
29150 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29151 pub chunk_seq: u8,
29152}
29153impl STATUSTEXT_DATA {
29154 pub const ENCODED_LEN: usize = 54usize;
29155 pub const DEFAULT: Self = Self {
29156 severity: MavSeverity::DEFAULT,
29157 text: CharArray::new([0_u8; 50usize]),
29158 id: 0_u16,
29159 chunk_seq: 0_u8,
29160 };
29161 #[cfg(feature = "arbitrary")]
29162 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29163 use arbitrary::{Arbitrary, Unstructured};
29164 let mut buf = [0u8; 1024];
29165 rng.fill_bytes(&mut buf);
29166 let mut unstructured = Unstructured::new(&buf);
29167 Self::arbitrary(&mut unstructured).unwrap_or_default()
29168 }
29169}
29170impl Default for STATUSTEXT_DATA {
29171 fn default() -> Self {
29172 Self::DEFAULT.clone()
29173 }
29174}
29175impl MessageData for STATUSTEXT_DATA {
29176 type Message = MavMessage;
29177 const ID: u32 = 253u32;
29178 const NAME: &'static str = "STATUSTEXT";
29179 const EXTRA_CRC: u8 = 83u8;
29180 const ENCODED_LEN: usize = 54usize;
29181 fn deser(
29182 _version: MavlinkVersion,
29183 __input: &[u8],
29184 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29185 let avail_len = __input.len();
29186 let mut payload_buf = [0; Self::ENCODED_LEN];
29187 let mut buf = if avail_len < Self::ENCODED_LEN {
29188 payload_buf[0..avail_len].copy_from_slice(__input);
29189 Bytes::new(&payload_buf)
29190 } else {
29191 Bytes::new(__input)
29192 };
29193 let mut __struct = Self::default();
29194 let tmp = buf.get_u8();
29195 __struct.severity =
29196 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29197 enum_type: "MavSeverity",
29198 value: tmp as u32,
29199 })?;
29200 let mut tmp = [0_u8; 50usize];
29201 for v in &mut tmp {
29202 *v = buf.get_u8();
29203 }
29204 __struct.text = CharArray::new(tmp);
29205 __struct.id = buf.get_u16_le();
29206 __struct.chunk_seq = buf.get_u8();
29207 Ok(__struct)
29208 }
29209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29210 let mut __tmp = BytesMut::new(bytes);
29211 #[allow(clippy::absurd_extreme_comparisons)]
29212 #[allow(unused_comparisons)]
29213 if __tmp.remaining() < Self::ENCODED_LEN {
29214 panic!(
29215 "buffer is too small (need {} bytes, but got {})",
29216 Self::ENCODED_LEN,
29217 __tmp.remaining(),
29218 )
29219 }
29220 __tmp.put_u8(self.severity as u8);
29221 for val in &self.text {
29222 __tmp.put_u8(*val);
29223 }
29224 if matches!(version, MavlinkVersion::V2) {
29225 __tmp.put_u16_le(self.id);
29226 __tmp.put_u8(self.chunk_seq);
29227 let len = __tmp.len();
29228 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29229 } else {
29230 __tmp.len()
29231 }
29232 }
29233}
29234#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29235#[doc = ""]
29236#[doc = "ID: 261"]
29237#[derive(Debug, Clone, PartialEq)]
29238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29240#[cfg_attr(feature = "ts", derive(TS))]
29241#[cfg_attr(feature = "ts", ts(export))]
29242pub struct STORAGE_INFORMATION_DATA {
29243 #[doc = "Timestamp (time since system boot)."]
29244 pub time_boot_ms: u32,
29245 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29246 pub total_capacity: f32,
29247 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29248 pub used_capacity: f32,
29249 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29250 pub available_capacity: f32,
29251 #[doc = "Read speed."]
29252 pub read_speed: f32,
29253 #[doc = "Write speed."]
29254 pub write_speed: f32,
29255 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29256 pub storage_id: u8,
29257 #[doc = "Number of storage devices"]
29258 pub storage_count: u8,
29259 #[doc = "Status of storage"]
29260 pub status: StorageStatus,
29261 #[doc = "Type of storage"]
29262 #[cfg_attr(feature = "serde", serde(default))]
29263 pub mavtype: StorageType,
29264 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29265 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29266 #[cfg_attr(feature = "ts", ts(type = "string"))]
29267 pub name: CharArray<32>,
29268 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29269 #[cfg_attr(feature = "serde", serde(default))]
29270 pub storage_usage: StorageUsageFlag,
29271}
29272impl STORAGE_INFORMATION_DATA {
29273 pub const ENCODED_LEN: usize = 61usize;
29274 pub const DEFAULT: Self = Self {
29275 time_boot_ms: 0_u32,
29276 total_capacity: 0.0_f32,
29277 used_capacity: 0.0_f32,
29278 available_capacity: 0.0_f32,
29279 read_speed: 0.0_f32,
29280 write_speed: 0.0_f32,
29281 storage_id: 0_u8,
29282 storage_count: 0_u8,
29283 status: StorageStatus::DEFAULT,
29284 mavtype: StorageType::DEFAULT,
29285 name: CharArray::new([0_u8; 32usize]),
29286 storage_usage: StorageUsageFlag::DEFAULT,
29287 };
29288 #[cfg(feature = "arbitrary")]
29289 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29290 use arbitrary::{Arbitrary, Unstructured};
29291 let mut buf = [0u8; 1024];
29292 rng.fill_bytes(&mut buf);
29293 let mut unstructured = Unstructured::new(&buf);
29294 Self::arbitrary(&mut unstructured).unwrap_or_default()
29295 }
29296}
29297impl Default for STORAGE_INFORMATION_DATA {
29298 fn default() -> Self {
29299 Self::DEFAULT.clone()
29300 }
29301}
29302impl MessageData for STORAGE_INFORMATION_DATA {
29303 type Message = MavMessage;
29304 const ID: u32 = 261u32;
29305 const NAME: &'static str = "STORAGE_INFORMATION";
29306 const EXTRA_CRC: u8 = 179u8;
29307 const ENCODED_LEN: usize = 61usize;
29308 fn deser(
29309 _version: MavlinkVersion,
29310 __input: &[u8],
29311 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29312 let avail_len = __input.len();
29313 let mut payload_buf = [0; Self::ENCODED_LEN];
29314 let mut buf = if avail_len < Self::ENCODED_LEN {
29315 payload_buf[0..avail_len].copy_from_slice(__input);
29316 Bytes::new(&payload_buf)
29317 } else {
29318 Bytes::new(__input)
29319 };
29320 let mut __struct = Self::default();
29321 __struct.time_boot_ms = buf.get_u32_le();
29322 __struct.total_capacity = buf.get_f32_le();
29323 __struct.used_capacity = buf.get_f32_le();
29324 __struct.available_capacity = buf.get_f32_le();
29325 __struct.read_speed = buf.get_f32_le();
29326 __struct.write_speed = buf.get_f32_le();
29327 __struct.storage_id = buf.get_u8();
29328 __struct.storage_count = buf.get_u8();
29329 let tmp = buf.get_u8();
29330 __struct.status =
29331 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29332 enum_type: "StorageStatus",
29333 value: tmp as u32,
29334 })?;
29335 let tmp = buf.get_u8();
29336 __struct.mavtype =
29337 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29338 enum_type: "StorageType",
29339 value: tmp as u32,
29340 })?;
29341 let mut tmp = [0_u8; 32usize];
29342 for v in &mut tmp {
29343 *v = buf.get_u8();
29344 }
29345 __struct.name = CharArray::new(tmp);
29346 let tmp = buf.get_u8();
29347 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
29348 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29349 flag_type: "StorageUsageFlag",
29350 value: tmp as u32,
29351 })?;
29352 Ok(__struct)
29353 }
29354 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29355 let mut __tmp = BytesMut::new(bytes);
29356 #[allow(clippy::absurd_extreme_comparisons)]
29357 #[allow(unused_comparisons)]
29358 if __tmp.remaining() < Self::ENCODED_LEN {
29359 panic!(
29360 "buffer is too small (need {} bytes, but got {})",
29361 Self::ENCODED_LEN,
29362 __tmp.remaining(),
29363 )
29364 }
29365 __tmp.put_u32_le(self.time_boot_ms);
29366 __tmp.put_f32_le(self.total_capacity);
29367 __tmp.put_f32_le(self.used_capacity);
29368 __tmp.put_f32_le(self.available_capacity);
29369 __tmp.put_f32_le(self.read_speed);
29370 __tmp.put_f32_le(self.write_speed);
29371 __tmp.put_u8(self.storage_id);
29372 __tmp.put_u8(self.storage_count);
29373 __tmp.put_u8(self.status as u8);
29374 if matches!(version, MavlinkVersion::V2) {
29375 __tmp.put_u8(self.mavtype as u8);
29376 for val in &self.name {
29377 __tmp.put_u8(*val);
29378 }
29379 __tmp.put_u8(self.storage_usage.bits());
29380 let len = __tmp.len();
29381 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29382 } else {
29383 __tmp.len()
29384 }
29385 }
29386}
29387#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29388#[doc = ""]
29389#[doc = "ID: 401"]
29390#[derive(Debug, Clone, PartialEq)]
29391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29393#[cfg_attr(feature = "ts", derive(TS))]
29394#[cfg_attr(feature = "ts", ts(export))]
29395pub struct SUPPORTED_TUNES_DATA {
29396 #[doc = "Bitfield of supported tune formats."]
29397 pub format: TuneFormat,
29398 #[doc = "System ID"]
29399 pub target_system: u8,
29400 #[doc = "Component ID"]
29401 pub target_component: u8,
29402}
29403impl SUPPORTED_TUNES_DATA {
29404 pub const ENCODED_LEN: usize = 6usize;
29405 pub const DEFAULT: Self = Self {
29406 format: TuneFormat::DEFAULT,
29407 target_system: 0_u8,
29408 target_component: 0_u8,
29409 };
29410 #[cfg(feature = "arbitrary")]
29411 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29412 use arbitrary::{Arbitrary, Unstructured};
29413 let mut buf = [0u8; 1024];
29414 rng.fill_bytes(&mut buf);
29415 let mut unstructured = Unstructured::new(&buf);
29416 Self::arbitrary(&mut unstructured).unwrap_or_default()
29417 }
29418}
29419impl Default for SUPPORTED_TUNES_DATA {
29420 fn default() -> Self {
29421 Self::DEFAULT.clone()
29422 }
29423}
29424impl MessageData for SUPPORTED_TUNES_DATA {
29425 type Message = MavMessage;
29426 const ID: u32 = 401u32;
29427 const NAME: &'static str = "SUPPORTED_TUNES";
29428 const EXTRA_CRC: u8 = 183u8;
29429 const ENCODED_LEN: usize = 6usize;
29430 fn deser(
29431 _version: MavlinkVersion,
29432 __input: &[u8],
29433 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29434 let avail_len = __input.len();
29435 let mut payload_buf = [0; Self::ENCODED_LEN];
29436 let mut buf = if avail_len < Self::ENCODED_LEN {
29437 payload_buf[0..avail_len].copy_from_slice(__input);
29438 Bytes::new(&payload_buf)
29439 } else {
29440 Bytes::new(__input)
29441 };
29442 let mut __struct = Self::default();
29443 let tmp = buf.get_u32_le();
29444 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29445 ::mavlink_core::error::ParserError::InvalidEnum {
29446 enum_type: "TuneFormat",
29447 value: tmp as u32,
29448 },
29449 )?;
29450 __struct.target_system = buf.get_u8();
29451 __struct.target_component = buf.get_u8();
29452 Ok(__struct)
29453 }
29454 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29455 let mut __tmp = BytesMut::new(bytes);
29456 #[allow(clippy::absurd_extreme_comparisons)]
29457 #[allow(unused_comparisons)]
29458 if __tmp.remaining() < Self::ENCODED_LEN {
29459 panic!(
29460 "buffer is too small (need {} bytes, but got {})",
29461 Self::ENCODED_LEN,
29462 __tmp.remaining(),
29463 )
29464 }
29465 __tmp.put_u32_le(self.format as u32);
29466 __tmp.put_u8(self.target_system);
29467 __tmp.put_u8(self.target_component);
29468 if matches!(version, MavlinkVersion::V2) {
29469 let len = __tmp.len();
29470 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29471 } else {
29472 __tmp.len()
29473 }
29474 }
29475}
29476#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29477#[doc = ""]
29478#[doc = "ID: 2"]
29479#[derive(Debug, Clone, PartialEq)]
29480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29482#[cfg_attr(feature = "ts", derive(TS))]
29483#[cfg_attr(feature = "ts", ts(export))]
29484pub struct SYSTEM_TIME_DATA {
29485 #[doc = "Timestamp (UNIX epoch time)."]
29486 pub time_unix_usec: u64,
29487 #[doc = "Timestamp (time since system boot)."]
29488 pub time_boot_ms: u32,
29489}
29490impl SYSTEM_TIME_DATA {
29491 pub const ENCODED_LEN: usize = 12usize;
29492 pub const DEFAULT: Self = Self {
29493 time_unix_usec: 0_u64,
29494 time_boot_ms: 0_u32,
29495 };
29496 #[cfg(feature = "arbitrary")]
29497 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29498 use arbitrary::{Arbitrary, Unstructured};
29499 let mut buf = [0u8; 1024];
29500 rng.fill_bytes(&mut buf);
29501 let mut unstructured = Unstructured::new(&buf);
29502 Self::arbitrary(&mut unstructured).unwrap_or_default()
29503 }
29504}
29505impl Default for SYSTEM_TIME_DATA {
29506 fn default() -> Self {
29507 Self::DEFAULT.clone()
29508 }
29509}
29510impl MessageData for SYSTEM_TIME_DATA {
29511 type Message = MavMessage;
29512 const ID: u32 = 2u32;
29513 const NAME: &'static str = "SYSTEM_TIME";
29514 const EXTRA_CRC: u8 = 137u8;
29515 const ENCODED_LEN: usize = 12usize;
29516 fn deser(
29517 _version: MavlinkVersion,
29518 __input: &[u8],
29519 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29520 let avail_len = __input.len();
29521 let mut payload_buf = [0; Self::ENCODED_LEN];
29522 let mut buf = if avail_len < Self::ENCODED_LEN {
29523 payload_buf[0..avail_len].copy_from_slice(__input);
29524 Bytes::new(&payload_buf)
29525 } else {
29526 Bytes::new(__input)
29527 };
29528 let mut __struct = Self::default();
29529 __struct.time_unix_usec = buf.get_u64_le();
29530 __struct.time_boot_ms = buf.get_u32_le();
29531 Ok(__struct)
29532 }
29533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29534 let mut __tmp = BytesMut::new(bytes);
29535 #[allow(clippy::absurd_extreme_comparisons)]
29536 #[allow(unused_comparisons)]
29537 if __tmp.remaining() < Self::ENCODED_LEN {
29538 panic!(
29539 "buffer is too small (need {} bytes, but got {})",
29540 Self::ENCODED_LEN,
29541 __tmp.remaining(),
29542 )
29543 }
29544 __tmp.put_u64_le(self.time_unix_usec);
29545 __tmp.put_u32_le(self.time_boot_ms);
29546 if matches!(version, MavlinkVersion::V2) {
29547 let len = __tmp.len();
29548 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29549 } else {
29550 __tmp.len()
29551 }
29552 }
29553}
29554#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29555#[doc = ""]
29556#[doc = "ID: 1"]
29557#[derive(Debug, Clone, PartialEq)]
29558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29559#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29560#[cfg_attr(feature = "ts", derive(TS))]
29561#[cfg_attr(feature = "ts", ts(export))]
29562pub struct SYS_STATUS_DATA {
29563 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29564 pub onboard_control_sensors_present: MavSysStatusSensor,
29565 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29566 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29567 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29568 pub onboard_control_sensors_health: MavSysStatusSensor,
29569 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29570 pub load: u16,
29571 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29572 pub voltage_battery: u16,
29573 #[doc = "Battery current, -1: Current not sent by autopilot"]
29574 pub current_battery: i16,
29575 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29576 pub drop_rate_comm: u16,
29577 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29578 pub errors_comm: u16,
29579 #[doc = "Autopilot-specific errors"]
29580 pub errors_count1: u16,
29581 #[doc = "Autopilot-specific errors"]
29582 pub errors_count2: u16,
29583 #[doc = "Autopilot-specific errors"]
29584 pub errors_count3: u16,
29585 #[doc = "Autopilot-specific errors"]
29586 pub errors_count4: u16,
29587 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29588 pub battery_remaining: i8,
29589 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29590 #[cfg_attr(feature = "serde", serde(default))]
29591 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29592 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29593 #[cfg_attr(feature = "serde", serde(default))]
29594 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29595 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29596 #[cfg_attr(feature = "serde", serde(default))]
29597 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29598}
29599impl SYS_STATUS_DATA {
29600 pub const ENCODED_LEN: usize = 43usize;
29601 pub const DEFAULT: Self = Self {
29602 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29603 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29604 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29605 load: 0_u16,
29606 voltage_battery: 0_u16,
29607 current_battery: 0_i16,
29608 drop_rate_comm: 0_u16,
29609 errors_comm: 0_u16,
29610 errors_count1: 0_u16,
29611 errors_count2: 0_u16,
29612 errors_count3: 0_u16,
29613 errors_count4: 0_u16,
29614 battery_remaining: 0_i8,
29615 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29616 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29617 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29618 };
29619 #[cfg(feature = "arbitrary")]
29620 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29621 use arbitrary::{Arbitrary, Unstructured};
29622 let mut buf = [0u8; 1024];
29623 rng.fill_bytes(&mut buf);
29624 let mut unstructured = Unstructured::new(&buf);
29625 Self::arbitrary(&mut unstructured).unwrap_or_default()
29626 }
29627}
29628impl Default for SYS_STATUS_DATA {
29629 fn default() -> Self {
29630 Self::DEFAULT.clone()
29631 }
29632}
29633impl MessageData for SYS_STATUS_DATA {
29634 type Message = MavMessage;
29635 const ID: u32 = 1u32;
29636 const NAME: &'static str = "SYS_STATUS";
29637 const EXTRA_CRC: u8 = 124u8;
29638 const ENCODED_LEN: usize = 43usize;
29639 fn deser(
29640 _version: MavlinkVersion,
29641 __input: &[u8],
29642 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29643 let avail_len = __input.len();
29644 let mut payload_buf = [0; Self::ENCODED_LEN];
29645 let mut buf = if avail_len < Self::ENCODED_LEN {
29646 payload_buf[0..avail_len].copy_from_slice(__input);
29647 Bytes::new(&payload_buf)
29648 } else {
29649 Bytes::new(__input)
29650 };
29651 let mut __struct = Self::default();
29652 let tmp = buf.get_u32_le();
29653 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29654 tmp & MavSysStatusSensor::all().bits(),
29655 )
29656 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29657 flag_type: "MavSysStatusSensor",
29658 value: tmp as u32,
29659 })?;
29660 let tmp = buf.get_u32_le();
29661 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29662 tmp & MavSysStatusSensor::all().bits(),
29663 )
29664 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29665 flag_type: "MavSysStatusSensor",
29666 value: tmp as u32,
29667 })?;
29668 let tmp = buf.get_u32_le();
29669 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29670 tmp & MavSysStatusSensor::all().bits(),
29671 )
29672 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29673 flag_type: "MavSysStatusSensor",
29674 value: tmp as u32,
29675 })?;
29676 __struct.load = buf.get_u16_le();
29677 __struct.voltage_battery = buf.get_u16_le();
29678 __struct.current_battery = buf.get_i16_le();
29679 __struct.drop_rate_comm = buf.get_u16_le();
29680 __struct.errors_comm = buf.get_u16_le();
29681 __struct.errors_count1 = buf.get_u16_le();
29682 __struct.errors_count2 = buf.get_u16_le();
29683 __struct.errors_count3 = buf.get_u16_le();
29684 __struct.errors_count4 = buf.get_u16_le();
29685 __struct.battery_remaining = buf.get_i8();
29686 let tmp = buf.get_u32_le();
29687 __struct.onboard_control_sensors_present_extended =
29688 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29689 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29690 flag_type: "MavSysStatusSensorExtended",
29691 value: tmp as u32,
29692 })?;
29693 let tmp = buf.get_u32_le();
29694 __struct.onboard_control_sensors_enabled_extended =
29695 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29696 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29697 flag_type: "MavSysStatusSensorExtended",
29698 value: tmp as u32,
29699 })?;
29700 let tmp = buf.get_u32_le();
29701 __struct.onboard_control_sensors_health_extended =
29702 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29703 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29704 flag_type: "MavSysStatusSensorExtended",
29705 value: tmp as u32,
29706 })?;
29707 Ok(__struct)
29708 }
29709 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29710 let mut __tmp = BytesMut::new(bytes);
29711 #[allow(clippy::absurd_extreme_comparisons)]
29712 #[allow(unused_comparisons)]
29713 if __tmp.remaining() < Self::ENCODED_LEN {
29714 panic!(
29715 "buffer is too small (need {} bytes, but got {})",
29716 Self::ENCODED_LEN,
29717 __tmp.remaining(),
29718 )
29719 }
29720 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
29721 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
29722 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
29723 __tmp.put_u16_le(self.load);
29724 __tmp.put_u16_le(self.voltage_battery);
29725 __tmp.put_i16_le(self.current_battery);
29726 __tmp.put_u16_le(self.drop_rate_comm);
29727 __tmp.put_u16_le(self.errors_comm);
29728 __tmp.put_u16_le(self.errors_count1);
29729 __tmp.put_u16_le(self.errors_count2);
29730 __tmp.put_u16_le(self.errors_count3);
29731 __tmp.put_u16_le(self.errors_count4);
29732 __tmp.put_i8(self.battery_remaining);
29733 if matches!(version, MavlinkVersion::V2) {
29734 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
29735 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
29736 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
29737 let len = __tmp.len();
29738 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29739 } else {
29740 __tmp.len()
29741 }
29742 }
29743}
29744#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29745#[doc = ""]
29746#[doc = "ID: 135"]
29747#[derive(Debug, Clone, PartialEq)]
29748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29750#[cfg_attr(feature = "ts", derive(TS))]
29751#[cfg_attr(feature = "ts", ts(export))]
29752pub struct TERRAIN_CHECK_DATA {
29753 #[doc = "Latitude"]
29754 pub lat: i32,
29755 #[doc = "Longitude"]
29756 pub lon: i32,
29757}
29758impl TERRAIN_CHECK_DATA {
29759 pub const ENCODED_LEN: usize = 8usize;
29760 pub const DEFAULT: Self = Self {
29761 lat: 0_i32,
29762 lon: 0_i32,
29763 };
29764 #[cfg(feature = "arbitrary")]
29765 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29766 use arbitrary::{Arbitrary, Unstructured};
29767 let mut buf = [0u8; 1024];
29768 rng.fill_bytes(&mut buf);
29769 let mut unstructured = Unstructured::new(&buf);
29770 Self::arbitrary(&mut unstructured).unwrap_or_default()
29771 }
29772}
29773impl Default for TERRAIN_CHECK_DATA {
29774 fn default() -> Self {
29775 Self::DEFAULT.clone()
29776 }
29777}
29778impl MessageData for TERRAIN_CHECK_DATA {
29779 type Message = MavMessage;
29780 const ID: u32 = 135u32;
29781 const NAME: &'static str = "TERRAIN_CHECK";
29782 const EXTRA_CRC: u8 = 203u8;
29783 const ENCODED_LEN: usize = 8usize;
29784 fn deser(
29785 _version: MavlinkVersion,
29786 __input: &[u8],
29787 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29788 let avail_len = __input.len();
29789 let mut payload_buf = [0; Self::ENCODED_LEN];
29790 let mut buf = if avail_len < Self::ENCODED_LEN {
29791 payload_buf[0..avail_len].copy_from_slice(__input);
29792 Bytes::new(&payload_buf)
29793 } else {
29794 Bytes::new(__input)
29795 };
29796 let mut __struct = Self::default();
29797 __struct.lat = buf.get_i32_le();
29798 __struct.lon = buf.get_i32_le();
29799 Ok(__struct)
29800 }
29801 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29802 let mut __tmp = BytesMut::new(bytes);
29803 #[allow(clippy::absurd_extreme_comparisons)]
29804 #[allow(unused_comparisons)]
29805 if __tmp.remaining() < Self::ENCODED_LEN {
29806 panic!(
29807 "buffer is too small (need {} bytes, but got {})",
29808 Self::ENCODED_LEN,
29809 __tmp.remaining(),
29810 )
29811 }
29812 __tmp.put_i32_le(self.lat);
29813 __tmp.put_i32_le(self.lon);
29814 if matches!(version, MavlinkVersion::V2) {
29815 let len = __tmp.len();
29816 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29817 } else {
29818 __tmp.len()
29819 }
29820 }
29821}
29822#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29823#[doc = ""]
29824#[doc = "ID: 134"]
29825#[derive(Debug, Clone, PartialEq)]
29826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29828#[cfg_attr(feature = "ts", derive(TS))]
29829#[cfg_attr(feature = "ts", ts(export))]
29830pub struct TERRAIN_DATA_DATA {
29831 #[doc = "Latitude of SW corner of first grid"]
29832 pub lat: i32,
29833 #[doc = "Longitude of SW corner of first grid"]
29834 pub lon: i32,
29835 #[doc = "Grid spacing"]
29836 pub grid_spacing: u16,
29837 #[doc = "Terrain data MSL"]
29838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29839 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29840 pub data: [i16; 16],
29841 #[doc = "bit within the terrain request mask"]
29842 pub gridbit: u8,
29843}
29844impl TERRAIN_DATA_DATA {
29845 pub const ENCODED_LEN: usize = 43usize;
29846 pub const DEFAULT: Self = Self {
29847 lat: 0_i32,
29848 lon: 0_i32,
29849 grid_spacing: 0_u16,
29850 data: [0_i16; 16usize],
29851 gridbit: 0_u8,
29852 };
29853 #[cfg(feature = "arbitrary")]
29854 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29855 use arbitrary::{Arbitrary, Unstructured};
29856 let mut buf = [0u8; 1024];
29857 rng.fill_bytes(&mut buf);
29858 let mut unstructured = Unstructured::new(&buf);
29859 Self::arbitrary(&mut unstructured).unwrap_or_default()
29860 }
29861}
29862impl Default for TERRAIN_DATA_DATA {
29863 fn default() -> Self {
29864 Self::DEFAULT.clone()
29865 }
29866}
29867impl MessageData for TERRAIN_DATA_DATA {
29868 type Message = MavMessage;
29869 const ID: u32 = 134u32;
29870 const NAME: &'static str = "TERRAIN_DATA";
29871 const EXTRA_CRC: u8 = 229u8;
29872 const ENCODED_LEN: usize = 43usize;
29873 fn deser(
29874 _version: MavlinkVersion,
29875 __input: &[u8],
29876 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29877 let avail_len = __input.len();
29878 let mut payload_buf = [0; Self::ENCODED_LEN];
29879 let mut buf = if avail_len < Self::ENCODED_LEN {
29880 payload_buf[0..avail_len].copy_from_slice(__input);
29881 Bytes::new(&payload_buf)
29882 } else {
29883 Bytes::new(__input)
29884 };
29885 let mut __struct = Self::default();
29886 __struct.lat = buf.get_i32_le();
29887 __struct.lon = buf.get_i32_le();
29888 __struct.grid_spacing = buf.get_u16_le();
29889 for v in &mut __struct.data {
29890 let val = buf.get_i16_le();
29891 *v = val;
29892 }
29893 __struct.gridbit = buf.get_u8();
29894 Ok(__struct)
29895 }
29896 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29897 let mut __tmp = BytesMut::new(bytes);
29898 #[allow(clippy::absurd_extreme_comparisons)]
29899 #[allow(unused_comparisons)]
29900 if __tmp.remaining() < Self::ENCODED_LEN {
29901 panic!(
29902 "buffer is too small (need {} bytes, but got {})",
29903 Self::ENCODED_LEN,
29904 __tmp.remaining(),
29905 )
29906 }
29907 __tmp.put_i32_le(self.lat);
29908 __tmp.put_i32_le(self.lon);
29909 __tmp.put_u16_le(self.grid_spacing);
29910 for val in &self.data {
29911 __tmp.put_i16_le(*val);
29912 }
29913 __tmp.put_u8(self.gridbit);
29914 if matches!(version, MavlinkVersion::V2) {
29915 let len = __tmp.len();
29916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29917 } else {
29918 __tmp.len()
29919 }
29920 }
29921}
29922#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29923#[doc = ""]
29924#[doc = "ID: 136"]
29925#[derive(Debug, Clone, PartialEq)]
29926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29927#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29928#[cfg_attr(feature = "ts", derive(TS))]
29929#[cfg_attr(feature = "ts", ts(export))]
29930pub struct TERRAIN_REPORT_DATA {
29931 #[doc = "Latitude"]
29932 pub lat: i32,
29933 #[doc = "Longitude"]
29934 pub lon: i32,
29935 #[doc = "Terrain height MSL"]
29936 pub terrain_height: f32,
29937 #[doc = "Current vehicle height above lat/lon terrain height"]
29938 pub current_height: f32,
29939 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29940 pub spacing: u16,
29941 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29942 pub pending: u16,
29943 #[doc = "Number of 4x4 terrain blocks in memory"]
29944 pub loaded: u16,
29945}
29946impl TERRAIN_REPORT_DATA {
29947 pub const ENCODED_LEN: usize = 22usize;
29948 pub const DEFAULT: Self = Self {
29949 lat: 0_i32,
29950 lon: 0_i32,
29951 terrain_height: 0.0_f32,
29952 current_height: 0.0_f32,
29953 spacing: 0_u16,
29954 pending: 0_u16,
29955 loaded: 0_u16,
29956 };
29957 #[cfg(feature = "arbitrary")]
29958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29959 use arbitrary::{Arbitrary, Unstructured};
29960 let mut buf = [0u8; 1024];
29961 rng.fill_bytes(&mut buf);
29962 let mut unstructured = Unstructured::new(&buf);
29963 Self::arbitrary(&mut unstructured).unwrap_or_default()
29964 }
29965}
29966impl Default for TERRAIN_REPORT_DATA {
29967 fn default() -> Self {
29968 Self::DEFAULT.clone()
29969 }
29970}
29971impl MessageData for TERRAIN_REPORT_DATA {
29972 type Message = MavMessage;
29973 const ID: u32 = 136u32;
29974 const NAME: &'static str = "TERRAIN_REPORT";
29975 const EXTRA_CRC: u8 = 1u8;
29976 const ENCODED_LEN: usize = 22usize;
29977 fn deser(
29978 _version: MavlinkVersion,
29979 __input: &[u8],
29980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29981 let avail_len = __input.len();
29982 let mut payload_buf = [0; Self::ENCODED_LEN];
29983 let mut buf = if avail_len < Self::ENCODED_LEN {
29984 payload_buf[0..avail_len].copy_from_slice(__input);
29985 Bytes::new(&payload_buf)
29986 } else {
29987 Bytes::new(__input)
29988 };
29989 let mut __struct = Self::default();
29990 __struct.lat = buf.get_i32_le();
29991 __struct.lon = buf.get_i32_le();
29992 __struct.terrain_height = buf.get_f32_le();
29993 __struct.current_height = buf.get_f32_le();
29994 __struct.spacing = buf.get_u16_le();
29995 __struct.pending = buf.get_u16_le();
29996 __struct.loaded = buf.get_u16_le();
29997 Ok(__struct)
29998 }
29999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30000 let mut __tmp = BytesMut::new(bytes);
30001 #[allow(clippy::absurd_extreme_comparisons)]
30002 #[allow(unused_comparisons)]
30003 if __tmp.remaining() < Self::ENCODED_LEN {
30004 panic!(
30005 "buffer is too small (need {} bytes, but got {})",
30006 Self::ENCODED_LEN,
30007 __tmp.remaining(),
30008 )
30009 }
30010 __tmp.put_i32_le(self.lat);
30011 __tmp.put_i32_le(self.lon);
30012 __tmp.put_f32_le(self.terrain_height);
30013 __tmp.put_f32_le(self.current_height);
30014 __tmp.put_u16_le(self.spacing);
30015 __tmp.put_u16_le(self.pending);
30016 __tmp.put_u16_le(self.loaded);
30017 if matches!(version, MavlinkVersion::V2) {
30018 let len = __tmp.len();
30019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30020 } else {
30021 __tmp.len()
30022 }
30023 }
30024}
30025#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30026#[doc = ""]
30027#[doc = "ID: 133"]
30028#[derive(Debug, Clone, PartialEq)]
30029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30031#[cfg_attr(feature = "ts", derive(TS))]
30032#[cfg_attr(feature = "ts", ts(export))]
30033pub struct TERRAIN_REQUEST_DATA {
30034 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
30035 pub mask: u64,
30036 #[doc = "Latitude of SW corner of first grid"]
30037 pub lat: i32,
30038 #[doc = "Longitude of SW corner of first grid"]
30039 pub lon: i32,
30040 #[doc = "Grid spacing"]
30041 pub grid_spacing: u16,
30042}
30043impl TERRAIN_REQUEST_DATA {
30044 pub const ENCODED_LEN: usize = 18usize;
30045 pub const DEFAULT: Self = Self {
30046 mask: 0_u64,
30047 lat: 0_i32,
30048 lon: 0_i32,
30049 grid_spacing: 0_u16,
30050 };
30051 #[cfg(feature = "arbitrary")]
30052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30053 use arbitrary::{Arbitrary, Unstructured};
30054 let mut buf = [0u8; 1024];
30055 rng.fill_bytes(&mut buf);
30056 let mut unstructured = Unstructured::new(&buf);
30057 Self::arbitrary(&mut unstructured).unwrap_or_default()
30058 }
30059}
30060impl Default for TERRAIN_REQUEST_DATA {
30061 fn default() -> Self {
30062 Self::DEFAULT.clone()
30063 }
30064}
30065impl MessageData for TERRAIN_REQUEST_DATA {
30066 type Message = MavMessage;
30067 const ID: u32 = 133u32;
30068 const NAME: &'static str = "TERRAIN_REQUEST";
30069 const EXTRA_CRC: u8 = 6u8;
30070 const ENCODED_LEN: usize = 18usize;
30071 fn deser(
30072 _version: MavlinkVersion,
30073 __input: &[u8],
30074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30075 let avail_len = __input.len();
30076 let mut payload_buf = [0; Self::ENCODED_LEN];
30077 let mut buf = if avail_len < Self::ENCODED_LEN {
30078 payload_buf[0..avail_len].copy_from_slice(__input);
30079 Bytes::new(&payload_buf)
30080 } else {
30081 Bytes::new(__input)
30082 };
30083 let mut __struct = Self::default();
30084 __struct.mask = buf.get_u64_le();
30085 __struct.lat = buf.get_i32_le();
30086 __struct.lon = buf.get_i32_le();
30087 __struct.grid_spacing = buf.get_u16_le();
30088 Ok(__struct)
30089 }
30090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30091 let mut __tmp = BytesMut::new(bytes);
30092 #[allow(clippy::absurd_extreme_comparisons)]
30093 #[allow(unused_comparisons)]
30094 if __tmp.remaining() < Self::ENCODED_LEN {
30095 panic!(
30096 "buffer is too small (need {} bytes, but got {})",
30097 Self::ENCODED_LEN,
30098 __tmp.remaining(),
30099 )
30100 }
30101 __tmp.put_u64_le(self.mask);
30102 __tmp.put_i32_le(self.lat);
30103 __tmp.put_i32_le(self.lon);
30104 __tmp.put_u16_le(self.grid_spacing);
30105 if matches!(version, MavlinkVersion::V2) {
30106 let len = __tmp.len();
30107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30108 } else {
30109 __tmp.len()
30110 }
30111 }
30112}
30113#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
30114#[doc = ""]
30115#[doc = "ID: 111"]
30116#[derive(Debug, Clone, PartialEq)]
30117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30119#[cfg_attr(feature = "ts", derive(TS))]
30120#[cfg_attr(feature = "ts", ts(export))]
30121pub struct TIMESYNC_DATA {
30122 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
30123 pub tc1: i64,
30124 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
30125 pub ts1: i64,
30126 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
30127 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30128 pub target_system: u8,
30129 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
30130 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30131 pub target_component: u8,
30132}
30133impl TIMESYNC_DATA {
30134 pub const ENCODED_LEN: usize = 18usize;
30135 pub const DEFAULT: Self = Self {
30136 tc1: 0_i64,
30137 ts1: 0_i64,
30138 target_system: 0_u8,
30139 target_component: 0_u8,
30140 };
30141 #[cfg(feature = "arbitrary")]
30142 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30143 use arbitrary::{Arbitrary, Unstructured};
30144 let mut buf = [0u8; 1024];
30145 rng.fill_bytes(&mut buf);
30146 let mut unstructured = Unstructured::new(&buf);
30147 Self::arbitrary(&mut unstructured).unwrap_or_default()
30148 }
30149}
30150impl Default for TIMESYNC_DATA {
30151 fn default() -> Self {
30152 Self::DEFAULT.clone()
30153 }
30154}
30155impl MessageData for TIMESYNC_DATA {
30156 type Message = MavMessage;
30157 const ID: u32 = 111u32;
30158 const NAME: &'static str = "TIMESYNC";
30159 const EXTRA_CRC: u8 = 34u8;
30160 const ENCODED_LEN: usize = 18usize;
30161 fn deser(
30162 _version: MavlinkVersion,
30163 __input: &[u8],
30164 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30165 let avail_len = __input.len();
30166 let mut payload_buf = [0; Self::ENCODED_LEN];
30167 let mut buf = if avail_len < Self::ENCODED_LEN {
30168 payload_buf[0..avail_len].copy_from_slice(__input);
30169 Bytes::new(&payload_buf)
30170 } else {
30171 Bytes::new(__input)
30172 };
30173 let mut __struct = Self::default();
30174 __struct.tc1 = buf.get_i64_le();
30175 __struct.ts1 = buf.get_i64_le();
30176 __struct.target_system = buf.get_u8();
30177 __struct.target_component = buf.get_u8();
30178 Ok(__struct)
30179 }
30180 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30181 let mut __tmp = BytesMut::new(bytes);
30182 #[allow(clippy::absurd_extreme_comparisons)]
30183 #[allow(unused_comparisons)]
30184 if __tmp.remaining() < Self::ENCODED_LEN {
30185 panic!(
30186 "buffer is too small (need {} bytes, but got {})",
30187 Self::ENCODED_LEN,
30188 __tmp.remaining(),
30189 )
30190 }
30191 __tmp.put_i64_le(self.tc1);
30192 __tmp.put_i64_le(self.ts1);
30193 if matches!(version, MavlinkVersion::V2) {
30194 __tmp.put_u8(self.target_system);
30195 __tmp.put_u8(self.target_component);
30196 let len = __tmp.len();
30197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30198 } else {
30199 __tmp.len()
30200 }
30201 }
30202}
30203#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30204#[doc = ""]
30205#[doc = "ID: 380"]
30206#[derive(Debug, Clone, PartialEq)]
30207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30209#[cfg_attr(feature = "ts", derive(TS))]
30210#[cfg_attr(feature = "ts", ts(export))]
30211pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30212 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30213 pub safe_return: i32,
30214 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30215 pub land: i32,
30216 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30217 pub mission_next_item: i32,
30218 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30219 pub mission_end: i32,
30220 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30221 pub commanded_action: i32,
30222}
30223impl TIME_ESTIMATE_TO_TARGET_DATA {
30224 pub const ENCODED_LEN: usize = 20usize;
30225 pub const DEFAULT: Self = Self {
30226 safe_return: 0_i32,
30227 land: 0_i32,
30228 mission_next_item: 0_i32,
30229 mission_end: 0_i32,
30230 commanded_action: 0_i32,
30231 };
30232 #[cfg(feature = "arbitrary")]
30233 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30234 use arbitrary::{Arbitrary, Unstructured};
30235 let mut buf = [0u8; 1024];
30236 rng.fill_bytes(&mut buf);
30237 let mut unstructured = Unstructured::new(&buf);
30238 Self::arbitrary(&mut unstructured).unwrap_or_default()
30239 }
30240}
30241impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30242 fn default() -> Self {
30243 Self::DEFAULT.clone()
30244 }
30245}
30246impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30247 type Message = MavMessage;
30248 const ID: u32 = 380u32;
30249 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30250 const EXTRA_CRC: u8 = 232u8;
30251 const ENCODED_LEN: usize = 20usize;
30252 fn deser(
30253 _version: MavlinkVersion,
30254 __input: &[u8],
30255 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30256 let avail_len = __input.len();
30257 let mut payload_buf = [0; Self::ENCODED_LEN];
30258 let mut buf = if avail_len < Self::ENCODED_LEN {
30259 payload_buf[0..avail_len].copy_from_slice(__input);
30260 Bytes::new(&payload_buf)
30261 } else {
30262 Bytes::new(__input)
30263 };
30264 let mut __struct = Self::default();
30265 __struct.safe_return = buf.get_i32_le();
30266 __struct.land = buf.get_i32_le();
30267 __struct.mission_next_item = buf.get_i32_le();
30268 __struct.mission_end = buf.get_i32_le();
30269 __struct.commanded_action = buf.get_i32_le();
30270 Ok(__struct)
30271 }
30272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30273 let mut __tmp = BytesMut::new(bytes);
30274 #[allow(clippy::absurd_extreme_comparisons)]
30275 #[allow(unused_comparisons)]
30276 if __tmp.remaining() < Self::ENCODED_LEN {
30277 panic!(
30278 "buffer is too small (need {} bytes, but got {})",
30279 Self::ENCODED_LEN,
30280 __tmp.remaining(),
30281 )
30282 }
30283 __tmp.put_i32_le(self.safe_return);
30284 __tmp.put_i32_le(self.land);
30285 __tmp.put_i32_le(self.mission_next_item);
30286 __tmp.put_i32_le(self.mission_end);
30287 __tmp.put_i32_le(self.commanded_action);
30288 if matches!(version, MavlinkVersion::V2) {
30289 let len = __tmp.len();
30290 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30291 } else {
30292 __tmp.len()
30293 }
30294 }
30295}
30296#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30297#[doc = ""]
30298#[doc = "ID: 333"]
30299#[derive(Debug, Clone, PartialEq)]
30300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30302#[cfg_attr(feature = "ts", derive(TS))]
30303#[cfg_attr(feature = "ts", ts(export))]
30304pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30305 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30306 pub time_usec: u64,
30307 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30308 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30309 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30310 pub pos_x: [f32; 5],
30311 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30312 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30313 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30314 pub pos_y: [f32; 5],
30315 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30316 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30317 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30318 pub pos_z: [f32; 5],
30319 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30320 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30321 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30322 pub delta: [f32; 5],
30323 #[doc = "Yaw. Set to NaN for unchanged"]
30324 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30325 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30326 pub pos_yaw: [f32; 5],
30327 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30328 pub valid_points: u8,
30329}
30330impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30331 pub const ENCODED_LEN: usize = 109usize;
30332 pub const DEFAULT: Self = Self {
30333 time_usec: 0_u64,
30334 pos_x: [0.0_f32; 5usize],
30335 pos_y: [0.0_f32; 5usize],
30336 pos_z: [0.0_f32; 5usize],
30337 delta: [0.0_f32; 5usize],
30338 pos_yaw: [0.0_f32; 5usize],
30339 valid_points: 0_u8,
30340 };
30341 #[cfg(feature = "arbitrary")]
30342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30343 use arbitrary::{Arbitrary, Unstructured};
30344 let mut buf = [0u8; 1024];
30345 rng.fill_bytes(&mut buf);
30346 let mut unstructured = Unstructured::new(&buf);
30347 Self::arbitrary(&mut unstructured).unwrap_or_default()
30348 }
30349}
30350impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30351 fn default() -> Self {
30352 Self::DEFAULT.clone()
30353 }
30354}
30355impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30356 type Message = MavMessage;
30357 const ID: u32 = 333u32;
30358 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30359 const EXTRA_CRC: u8 = 231u8;
30360 const ENCODED_LEN: usize = 109usize;
30361 fn deser(
30362 _version: MavlinkVersion,
30363 __input: &[u8],
30364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30365 let avail_len = __input.len();
30366 let mut payload_buf = [0; Self::ENCODED_LEN];
30367 let mut buf = if avail_len < Self::ENCODED_LEN {
30368 payload_buf[0..avail_len].copy_from_slice(__input);
30369 Bytes::new(&payload_buf)
30370 } else {
30371 Bytes::new(__input)
30372 };
30373 let mut __struct = Self::default();
30374 __struct.time_usec = buf.get_u64_le();
30375 for v in &mut __struct.pos_x {
30376 let val = buf.get_f32_le();
30377 *v = val;
30378 }
30379 for v in &mut __struct.pos_y {
30380 let val = buf.get_f32_le();
30381 *v = val;
30382 }
30383 for v in &mut __struct.pos_z {
30384 let val = buf.get_f32_le();
30385 *v = val;
30386 }
30387 for v in &mut __struct.delta {
30388 let val = buf.get_f32_le();
30389 *v = val;
30390 }
30391 for v in &mut __struct.pos_yaw {
30392 let val = buf.get_f32_le();
30393 *v = val;
30394 }
30395 __struct.valid_points = buf.get_u8();
30396 Ok(__struct)
30397 }
30398 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30399 let mut __tmp = BytesMut::new(bytes);
30400 #[allow(clippy::absurd_extreme_comparisons)]
30401 #[allow(unused_comparisons)]
30402 if __tmp.remaining() < Self::ENCODED_LEN {
30403 panic!(
30404 "buffer is too small (need {} bytes, but got {})",
30405 Self::ENCODED_LEN,
30406 __tmp.remaining(),
30407 )
30408 }
30409 __tmp.put_u64_le(self.time_usec);
30410 for val in &self.pos_x {
30411 __tmp.put_f32_le(*val);
30412 }
30413 for val in &self.pos_y {
30414 __tmp.put_f32_le(*val);
30415 }
30416 for val in &self.pos_z {
30417 __tmp.put_f32_le(*val);
30418 }
30419 for val in &self.delta {
30420 __tmp.put_f32_le(*val);
30421 }
30422 for val in &self.pos_yaw {
30423 __tmp.put_f32_le(*val);
30424 }
30425 __tmp.put_u8(self.valid_points);
30426 if matches!(version, MavlinkVersion::V2) {
30427 let len = __tmp.len();
30428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30429 } else {
30430 __tmp.len()
30431 }
30432 }
30433}
30434#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30435#[doc = ""]
30436#[doc = "ID: 332"]
30437#[derive(Debug, Clone, PartialEq)]
30438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30440#[cfg_attr(feature = "ts", derive(TS))]
30441#[cfg_attr(feature = "ts", ts(export))]
30442pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30443 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30444 pub time_usec: u64,
30445 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30446 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30447 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30448 pub pos_x: [f32; 5],
30449 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30451 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30452 pub pos_y: [f32; 5],
30453 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30454 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30455 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30456 pub pos_z: [f32; 5],
30457 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30458 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30459 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30460 pub vel_x: [f32; 5],
30461 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30462 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30463 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30464 pub vel_y: [f32; 5],
30465 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30466 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30467 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30468 pub vel_z: [f32; 5],
30469 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30470 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30471 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30472 pub acc_x: [f32; 5],
30473 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30474 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30475 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30476 pub acc_y: [f32; 5],
30477 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30478 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30479 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30480 pub acc_z: [f32; 5],
30481 #[doc = "Yaw angle, set to NaN if not being used"]
30482 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30483 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30484 pub pos_yaw: [f32; 5],
30485 #[doc = "Yaw rate, set to NaN if not being used"]
30486 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30487 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30488 pub vel_yaw: [f32; 5],
30489 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30490 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30491 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30492 pub command: [u16; 5],
30493 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30494 pub valid_points: u8,
30495}
30496impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30497 pub const ENCODED_LEN: usize = 239usize;
30498 pub const DEFAULT: Self = Self {
30499 time_usec: 0_u64,
30500 pos_x: [0.0_f32; 5usize],
30501 pos_y: [0.0_f32; 5usize],
30502 pos_z: [0.0_f32; 5usize],
30503 vel_x: [0.0_f32; 5usize],
30504 vel_y: [0.0_f32; 5usize],
30505 vel_z: [0.0_f32; 5usize],
30506 acc_x: [0.0_f32; 5usize],
30507 acc_y: [0.0_f32; 5usize],
30508 acc_z: [0.0_f32; 5usize],
30509 pos_yaw: [0.0_f32; 5usize],
30510 vel_yaw: [0.0_f32; 5usize],
30511 command: [0_u16; 5usize],
30512 valid_points: 0_u8,
30513 };
30514 #[cfg(feature = "arbitrary")]
30515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30516 use arbitrary::{Arbitrary, Unstructured};
30517 let mut buf = [0u8; 1024];
30518 rng.fill_bytes(&mut buf);
30519 let mut unstructured = Unstructured::new(&buf);
30520 Self::arbitrary(&mut unstructured).unwrap_or_default()
30521 }
30522}
30523impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30524 fn default() -> Self {
30525 Self::DEFAULT.clone()
30526 }
30527}
30528impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30529 type Message = MavMessage;
30530 const ID: u32 = 332u32;
30531 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30532 const EXTRA_CRC: u8 = 236u8;
30533 const ENCODED_LEN: usize = 239usize;
30534 fn deser(
30535 _version: MavlinkVersion,
30536 __input: &[u8],
30537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30538 let avail_len = __input.len();
30539 let mut payload_buf = [0; Self::ENCODED_LEN];
30540 let mut buf = if avail_len < Self::ENCODED_LEN {
30541 payload_buf[0..avail_len].copy_from_slice(__input);
30542 Bytes::new(&payload_buf)
30543 } else {
30544 Bytes::new(__input)
30545 };
30546 let mut __struct = Self::default();
30547 __struct.time_usec = buf.get_u64_le();
30548 for v in &mut __struct.pos_x {
30549 let val = buf.get_f32_le();
30550 *v = val;
30551 }
30552 for v in &mut __struct.pos_y {
30553 let val = buf.get_f32_le();
30554 *v = val;
30555 }
30556 for v in &mut __struct.pos_z {
30557 let val = buf.get_f32_le();
30558 *v = val;
30559 }
30560 for v in &mut __struct.vel_x {
30561 let val = buf.get_f32_le();
30562 *v = val;
30563 }
30564 for v in &mut __struct.vel_y {
30565 let val = buf.get_f32_le();
30566 *v = val;
30567 }
30568 for v in &mut __struct.vel_z {
30569 let val = buf.get_f32_le();
30570 *v = val;
30571 }
30572 for v in &mut __struct.acc_x {
30573 let val = buf.get_f32_le();
30574 *v = val;
30575 }
30576 for v in &mut __struct.acc_y {
30577 let val = buf.get_f32_le();
30578 *v = val;
30579 }
30580 for v in &mut __struct.acc_z {
30581 let val = buf.get_f32_le();
30582 *v = val;
30583 }
30584 for v in &mut __struct.pos_yaw {
30585 let val = buf.get_f32_le();
30586 *v = val;
30587 }
30588 for v in &mut __struct.vel_yaw {
30589 let val = buf.get_f32_le();
30590 *v = val;
30591 }
30592 for v in &mut __struct.command {
30593 let val = buf.get_u16_le();
30594 *v = val;
30595 }
30596 __struct.valid_points = buf.get_u8();
30597 Ok(__struct)
30598 }
30599 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30600 let mut __tmp = BytesMut::new(bytes);
30601 #[allow(clippy::absurd_extreme_comparisons)]
30602 #[allow(unused_comparisons)]
30603 if __tmp.remaining() < Self::ENCODED_LEN {
30604 panic!(
30605 "buffer is too small (need {} bytes, but got {})",
30606 Self::ENCODED_LEN,
30607 __tmp.remaining(),
30608 )
30609 }
30610 __tmp.put_u64_le(self.time_usec);
30611 for val in &self.pos_x {
30612 __tmp.put_f32_le(*val);
30613 }
30614 for val in &self.pos_y {
30615 __tmp.put_f32_le(*val);
30616 }
30617 for val in &self.pos_z {
30618 __tmp.put_f32_le(*val);
30619 }
30620 for val in &self.vel_x {
30621 __tmp.put_f32_le(*val);
30622 }
30623 for val in &self.vel_y {
30624 __tmp.put_f32_le(*val);
30625 }
30626 for val in &self.vel_z {
30627 __tmp.put_f32_le(*val);
30628 }
30629 for val in &self.acc_x {
30630 __tmp.put_f32_le(*val);
30631 }
30632 for val in &self.acc_y {
30633 __tmp.put_f32_le(*val);
30634 }
30635 for val in &self.acc_z {
30636 __tmp.put_f32_le(*val);
30637 }
30638 for val in &self.pos_yaw {
30639 __tmp.put_f32_le(*val);
30640 }
30641 for val in &self.vel_yaw {
30642 __tmp.put_f32_le(*val);
30643 }
30644 for val in &self.command {
30645 __tmp.put_u16_le(*val);
30646 }
30647 __tmp.put_u8(self.valid_points);
30648 if matches!(version, MavlinkVersion::V2) {
30649 let len = __tmp.len();
30650 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30651 } else {
30652 __tmp.len()
30653 }
30654 }
30655}
30656#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30657#[doc = ""]
30658#[doc = "ID: 385"]
30659#[derive(Debug, Clone, PartialEq)]
30660#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30661#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30662#[cfg_attr(feature = "ts", derive(TS))]
30663#[cfg_attr(feature = "ts", ts(export))]
30664pub struct TUNNEL_DATA {
30665 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30666 pub payload_type: MavTunnelPayloadType,
30667 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30668 pub target_system: u8,
30669 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30670 pub target_component: u8,
30671 #[doc = "Length of the data transported in payload"]
30672 pub payload_length: u8,
30673 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30674 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30675 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30676 pub payload: [u8; 128],
30677}
30678impl TUNNEL_DATA {
30679 pub const ENCODED_LEN: usize = 133usize;
30680 pub const DEFAULT: Self = Self {
30681 payload_type: MavTunnelPayloadType::DEFAULT,
30682 target_system: 0_u8,
30683 target_component: 0_u8,
30684 payload_length: 0_u8,
30685 payload: [0_u8; 128usize],
30686 };
30687 #[cfg(feature = "arbitrary")]
30688 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30689 use arbitrary::{Arbitrary, Unstructured};
30690 let mut buf = [0u8; 1024];
30691 rng.fill_bytes(&mut buf);
30692 let mut unstructured = Unstructured::new(&buf);
30693 Self::arbitrary(&mut unstructured).unwrap_or_default()
30694 }
30695}
30696impl Default for TUNNEL_DATA {
30697 fn default() -> Self {
30698 Self::DEFAULT.clone()
30699 }
30700}
30701impl MessageData for TUNNEL_DATA {
30702 type Message = MavMessage;
30703 const ID: u32 = 385u32;
30704 const NAME: &'static str = "TUNNEL";
30705 const EXTRA_CRC: u8 = 147u8;
30706 const ENCODED_LEN: usize = 133usize;
30707 fn deser(
30708 _version: MavlinkVersion,
30709 __input: &[u8],
30710 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30711 let avail_len = __input.len();
30712 let mut payload_buf = [0; Self::ENCODED_LEN];
30713 let mut buf = if avail_len < Self::ENCODED_LEN {
30714 payload_buf[0..avail_len].copy_from_slice(__input);
30715 Bytes::new(&payload_buf)
30716 } else {
30717 Bytes::new(__input)
30718 };
30719 let mut __struct = Self::default();
30720 let tmp = buf.get_u16_le();
30721 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30722 ::mavlink_core::error::ParserError::InvalidEnum {
30723 enum_type: "MavTunnelPayloadType",
30724 value: tmp as u32,
30725 },
30726 )?;
30727 __struct.target_system = buf.get_u8();
30728 __struct.target_component = buf.get_u8();
30729 __struct.payload_length = buf.get_u8();
30730 for v in &mut __struct.payload {
30731 let val = buf.get_u8();
30732 *v = val;
30733 }
30734 Ok(__struct)
30735 }
30736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30737 let mut __tmp = BytesMut::new(bytes);
30738 #[allow(clippy::absurd_extreme_comparisons)]
30739 #[allow(unused_comparisons)]
30740 if __tmp.remaining() < Self::ENCODED_LEN {
30741 panic!(
30742 "buffer is too small (need {} bytes, but got {})",
30743 Self::ENCODED_LEN,
30744 __tmp.remaining(),
30745 )
30746 }
30747 __tmp.put_u16_le(self.payload_type as u16);
30748 __tmp.put_u8(self.target_system);
30749 __tmp.put_u8(self.target_component);
30750 __tmp.put_u8(self.payload_length);
30751 for val in &self.payload {
30752 __tmp.put_u8(*val);
30753 }
30754 if matches!(version, MavlinkVersion::V2) {
30755 let len = __tmp.len();
30756 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30757 } else {
30758 __tmp.len()
30759 }
30760 }
30761}
30762#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
30763#[doc = ""]
30764#[doc = "ID: 311"]
30765#[derive(Debug, Clone, PartialEq)]
30766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30768#[cfg_attr(feature = "ts", derive(TS))]
30769#[cfg_attr(feature = "ts", ts(export))]
30770pub struct UAVCAN_NODE_INFO_DATA {
30771 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30772 pub time_usec: u64,
30773 #[doc = "Time since the start-up of the node."]
30774 pub uptime_sec: u32,
30775 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
30776 pub sw_vcs_commit: u32,
30777 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
30778 #[cfg_attr(feature = "ts", ts(type = "string"))]
30779 pub name: CharArray<80>,
30780 #[doc = "Hardware major version number."]
30781 pub hw_version_major: u8,
30782 #[doc = "Hardware minor version number."]
30783 pub hw_version_minor: u8,
30784 #[doc = "Hardware unique 128-bit ID."]
30785 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30786 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30787 pub hw_unique_id: [u8; 16],
30788 #[doc = "Software major version number."]
30789 pub sw_version_major: u8,
30790 #[doc = "Software minor version number."]
30791 pub sw_version_minor: u8,
30792}
30793impl UAVCAN_NODE_INFO_DATA {
30794 pub const ENCODED_LEN: usize = 116usize;
30795 pub const DEFAULT: Self = Self {
30796 time_usec: 0_u64,
30797 uptime_sec: 0_u32,
30798 sw_vcs_commit: 0_u32,
30799 name: CharArray::new([0_u8; 80usize]),
30800 hw_version_major: 0_u8,
30801 hw_version_minor: 0_u8,
30802 hw_unique_id: [0_u8; 16usize],
30803 sw_version_major: 0_u8,
30804 sw_version_minor: 0_u8,
30805 };
30806 #[cfg(feature = "arbitrary")]
30807 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30808 use arbitrary::{Arbitrary, Unstructured};
30809 let mut buf = [0u8; 1024];
30810 rng.fill_bytes(&mut buf);
30811 let mut unstructured = Unstructured::new(&buf);
30812 Self::arbitrary(&mut unstructured).unwrap_or_default()
30813 }
30814}
30815impl Default for UAVCAN_NODE_INFO_DATA {
30816 fn default() -> Self {
30817 Self::DEFAULT.clone()
30818 }
30819}
30820impl MessageData for UAVCAN_NODE_INFO_DATA {
30821 type Message = MavMessage;
30822 const ID: u32 = 311u32;
30823 const NAME: &'static str = "UAVCAN_NODE_INFO";
30824 const EXTRA_CRC: u8 = 95u8;
30825 const ENCODED_LEN: usize = 116usize;
30826 fn deser(
30827 _version: MavlinkVersion,
30828 __input: &[u8],
30829 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30830 let avail_len = __input.len();
30831 let mut payload_buf = [0; Self::ENCODED_LEN];
30832 let mut buf = if avail_len < Self::ENCODED_LEN {
30833 payload_buf[0..avail_len].copy_from_slice(__input);
30834 Bytes::new(&payload_buf)
30835 } else {
30836 Bytes::new(__input)
30837 };
30838 let mut __struct = Self::default();
30839 __struct.time_usec = buf.get_u64_le();
30840 __struct.uptime_sec = buf.get_u32_le();
30841 __struct.sw_vcs_commit = buf.get_u32_le();
30842 let mut tmp = [0_u8; 80usize];
30843 for v in &mut tmp {
30844 *v = buf.get_u8();
30845 }
30846 __struct.name = CharArray::new(tmp);
30847 __struct.hw_version_major = buf.get_u8();
30848 __struct.hw_version_minor = buf.get_u8();
30849 for v in &mut __struct.hw_unique_id {
30850 let val = buf.get_u8();
30851 *v = val;
30852 }
30853 __struct.sw_version_major = buf.get_u8();
30854 __struct.sw_version_minor = buf.get_u8();
30855 Ok(__struct)
30856 }
30857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30858 let mut __tmp = BytesMut::new(bytes);
30859 #[allow(clippy::absurd_extreme_comparisons)]
30860 #[allow(unused_comparisons)]
30861 if __tmp.remaining() < Self::ENCODED_LEN {
30862 panic!(
30863 "buffer is too small (need {} bytes, but got {})",
30864 Self::ENCODED_LEN,
30865 __tmp.remaining(),
30866 )
30867 }
30868 __tmp.put_u64_le(self.time_usec);
30869 __tmp.put_u32_le(self.uptime_sec);
30870 __tmp.put_u32_le(self.sw_vcs_commit);
30871 for val in &self.name {
30872 __tmp.put_u8(*val);
30873 }
30874 __tmp.put_u8(self.hw_version_major);
30875 __tmp.put_u8(self.hw_version_minor);
30876 for val in &self.hw_unique_id {
30877 __tmp.put_u8(*val);
30878 }
30879 __tmp.put_u8(self.sw_version_major);
30880 __tmp.put_u8(self.sw_version_minor);
30881 if matches!(version, MavlinkVersion::V2) {
30882 let len = __tmp.len();
30883 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30884 } else {
30885 __tmp.len()
30886 }
30887 }
30888}
30889#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30890#[doc = ""]
30891#[doc = "ID: 310"]
30892#[derive(Debug, Clone, PartialEq)]
30893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30894#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30895#[cfg_attr(feature = "ts", derive(TS))]
30896#[cfg_attr(feature = "ts", ts(export))]
30897pub struct UAVCAN_NODE_STATUS_DATA {
30898 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30899 pub time_usec: u64,
30900 #[doc = "Time since the start-up of the node."]
30901 pub uptime_sec: u32,
30902 #[doc = "Vendor-specific status information."]
30903 pub vendor_specific_status_code: u16,
30904 #[doc = "Generalized node health status."]
30905 pub health: UavcanNodeHealth,
30906 #[doc = "Generalized operating mode."]
30907 pub mode: UavcanNodeMode,
30908 #[doc = "Not used currently."]
30909 pub sub_mode: u8,
30910}
30911impl UAVCAN_NODE_STATUS_DATA {
30912 pub const ENCODED_LEN: usize = 17usize;
30913 pub const DEFAULT: Self = Self {
30914 time_usec: 0_u64,
30915 uptime_sec: 0_u32,
30916 vendor_specific_status_code: 0_u16,
30917 health: UavcanNodeHealth::DEFAULT,
30918 mode: UavcanNodeMode::DEFAULT,
30919 sub_mode: 0_u8,
30920 };
30921 #[cfg(feature = "arbitrary")]
30922 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30923 use arbitrary::{Arbitrary, Unstructured};
30924 let mut buf = [0u8; 1024];
30925 rng.fill_bytes(&mut buf);
30926 let mut unstructured = Unstructured::new(&buf);
30927 Self::arbitrary(&mut unstructured).unwrap_or_default()
30928 }
30929}
30930impl Default for UAVCAN_NODE_STATUS_DATA {
30931 fn default() -> Self {
30932 Self::DEFAULT.clone()
30933 }
30934}
30935impl MessageData for UAVCAN_NODE_STATUS_DATA {
30936 type Message = MavMessage;
30937 const ID: u32 = 310u32;
30938 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30939 const EXTRA_CRC: u8 = 28u8;
30940 const ENCODED_LEN: usize = 17usize;
30941 fn deser(
30942 _version: MavlinkVersion,
30943 __input: &[u8],
30944 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30945 let avail_len = __input.len();
30946 let mut payload_buf = [0; Self::ENCODED_LEN];
30947 let mut buf = if avail_len < Self::ENCODED_LEN {
30948 payload_buf[0..avail_len].copy_from_slice(__input);
30949 Bytes::new(&payload_buf)
30950 } else {
30951 Bytes::new(__input)
30952 };
30953 let mut __struct = Self::default();
30954 __struct.time_usec = buf.get_u64_le();
30955 __struct.uptime_sec = buf.get_u32_le();
30956 __struct.vendor_specific_status_code = buf.get_u16_le();
30957 let tmp = buf.get_u8();
30958 __struct.health =
30959 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30960 enum_type: "UavcanNodeHealth",
30961 value: tmp as u32,
30962 })?;
30963 let tmp = buf.get_u8();
30964 __struct.mode =
30965 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30966 enum_type: "UavcanNodeMode",
30967 value: tmp as u32,
30968 })?;
30969 __struct.sub_mode = buf.get_u8();
30970 Ok(__struct)
30971 }
30972 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30973 let mut __tmp = BytesMut::new(bytes);
30974 #[allow(clippy::absurd_extreme_comparisons)]
30975 #[allow(unused_comparisons)]
30976 if __tmp.remaining() < Self::ENCODED_LEN {
30977 panic!(
30978 "buffer is too small (need {} bytes, but got {})",
30979 Self::ENCODED_LEN,
30980 __tmp.remaining(),
30981 )
30982 }
30983 __tmp.put_u64_le(self.time_usec);
30984 __tmp.put_u32_le(self.uptime_sec);
30985 __tmp.put_u16_le(self.vendor_specific_status_code);
30986 __tmp.put_u8(self.health as u8);
30987 __tmp.put_u8(self.mode as u8);
30988 __tmp.put_u8(self.sub_mode);
30989 if matches!(version, MavlinkVersion::V2) {
30990 let len = __tmp.len();
30991 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30992 } else {
30993 __tmp.len()
30994 }
30995 }
30996}
30997#[doc = "The global position resulting from GPS and sensor fusion."]
30998#[doc = ""]
30999#[doc = "ID: 340"]
31000#[derive(Debug, Clone, PartialEq)]
31001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31003#[cfg_attr(feature = "ts", derive(TS))]
31004#[cfg_attr(feature = "ts", ts(export))]
31005pub struct UTM_GLOBAL_POSITION_DATA {
31006 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
31007 pub time: u64,
31008 #[doc = "Latitude (WGS84)"]
31009 pub lat: i32,
31010 #[doc = "Longitude (WGS84)"]
31011 pub lon: i32,
31012 #[doc = "Altitude (WGS84)"]
31013 pub alt: i32,
31014 #[doc = "Altitude above ground"]
31015 pub relative_alt: i32,
31016 #[doc = "Next waypoint, latitude (WGS84)"]
31017 pub next_lat: i32,
31018 #[doc = "Next waypoint, longitude (WGS84)"]
31019 pub next_lon: i32,
31020 #[doc = "Next waypoint, altitude (WGS84)"]
31021 pub next_alt: i32,
31022 #[doc = "Ground X speed (latitude, positive north)"]
31023 pub vx: i16,
31024 #[doc = "Ground Y speed (longitude, positive east)"]
31025 pub vy: i16,
31026 #[doc = "Ground Z speed (altitude, positive down)"]
31027 pub vz: i16,
31028 #[doc = "Horizontal position uncertainty (standard deviation)"]
31029 pub h_acc: u16,
31030 #[doc = "Altitude uncertainty (standard deviation)"]
31031 pub v_acc: u16,
31032 #[doc = "Speed uncertainty (standard deviation)"]
31033 pub vel_acc: u16,
31034 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
31035 pub update_rate: u16,
31036 #[doc = "Unique UAS ID."]
31037 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31038 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31039 pub uas_id: [u8; 18],
31040 #[doc = "Flight state"]
31041 pub flight_state: UtmFlightState,
31042 #[doc = "Bitwise OR combination of the data available flags."]
31043 pub flags: UtmDataAvailFlags,
31044}
31045impl UTM_GLOBAL_POSITION_DATA {
31046 pub const ENCODED_LEN: usize = 70usize;
31047 pub const DEFAULT: Self = Self {
31048 time: 0_u64,
31049 lat: 0_i32,
31050 lon: 0_i32,
31051 alt: 0_i32,
31052 relative_alt: 0_i32,
31053 next_lat: 0_i32,
31054 next_lon: 0_i32,
31055 next_alt: 0_i32,
31056 vx: 0_i16,
31057 vy: 0_i16,
31058 vz: 0_i16,
31059 h_acc: 0_u16,
31060 v_acc: 0_u16,
31061 vel_acc: 0_u16,
31062 update_rate: 0_u16,
31063 uas_id: [0_u8; 18usize],
31064 flight_state: UtmFlightState::DEFAULT,
31065 flags: UtmDataAvailFlags::DEFAULT,
31066 };
31067 #[cfg(feature = "arbitrary")]
31068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31069 use arbitrary::{Arbitrary, Unstructured};
31070 let mut buf = [0u8; 1024];
31071 rng.fill_bytes(&mut buf);
31072 let mut unstructured = Unstructured::new(&buf);
31073 Self::arbitrary(&mut unstructured).unwrap_or_default()
31074 }
31075}
31076impl Default for UTM_GLOBAL_POSITION_DATA {
31077 fn default() -> Self {
31078 Self::DEFAULT.clone()
31079 }
31080}
31081impl MessageData for UTM_GLOBAL_POSITION_DATA {
31082 type Message = MavMessage;
31083 const ID: u32 = 340u32;
31084 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31085 const EXTRA_CRC: u8 = 99u8;
31086 const ENCODED_LEN: usize = 70usize;
31087 fn deser(
31088 _version: MavlinkVersion,
31089 __input: &[u8],
31090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31091 let avail_len = __input.len();
31092 let mut payload_buf = [0; Self::ENCODED_LEN];
31093 let mut buf = if avail_len < Self::ENCODED_LEN {
31094 payload_buf[0..avail_len].copy_from_slice(__input);
31095 Bytes::new(&payload_buf)
31096 } else {
31097 Bytes::new(__input)
31098 };
31099 let mut __struct = Self::default();
31100 __struct.time = buf.get_u64_le();
31101 __struct.lat = buf.get_i32_le();
31102 __struct.lon = buf.get_i32_le();
31103 __struct.alt = buf.get_i32_le();
31104 __struct.relative_alt = buf.get_i32_le();
31105 __struct.next_lat = buf.get_i32_le();
31106 __struct.next_lon = buf.get_i32_le();
31107 __struct.next_alt = buf.get_i32_le();
31108 __struct.vx = buf.get_i16_le();
31109 __struct.vy = buf.get_i16_le();
31110 __struct.vz = buf.get_i16_le();
31111 __struct.h_acc = buf.get_u16_le();
31112 __struct.v_acc = buf.get_u16_le();
31113 __struct.vel_acc = buf.get_u16_le();
31114 __struct.update_rate = buf.get_u16_le();
31115 for v in &mut __struct.uas_id {
31116 let val = buf.get_u8();
31117 *v = val;
31118 }
31119 let tmp = buf.get_u8();
31120 __struct.flight_state =
31121 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31122 enum_type: "UtmFlightState",
31123 value: tmp as u32,
31124 })?;
31125 let tmp = buf.get_u8();
31126 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
31127 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31128 flag_type: "UtmDataAvailFlags",
31129 value: tmp as u32,
31130 })?;
31131 Ok(__struct)
31132 }
31133 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31134 let mut __tmp = BytesMut::new(bytes);
31135 #[allow(clippy::absurd_extreme_comparisons)]
31136 #[allow(unused_comparisons)]
31137 if __tmp.remaining() < Self::ENCODED_LEN {
31138 panic!(
31139 "buffer is too small (need {} bytes, but got {})",
31140 Self::ENCODED_LEN,
31141 __tmp.remaining(),
31142 )
31143 }
31144 __tmp.put_u64_le(self.time);
31145 __tmp.put_i32_le(self.lat);
31146 __tmp.put_i32_le(self.lon);
31147 __tmp.put_i32_le(self.alt);
31148 __tmp.put_i32_le(self.relative_alt);
31149 __tmp.put_i32_le(self.next_lat);
31150 __tmp.put_i32_le(self.next_lon);
31151 __tmp.put_i32_le(self.next_alt);
31152 __tmp.put_i16_le(self.vx);
31153 __tmp.put_i16_le(self.vy);
31154 __tmp.put_i16_le(self.vz);
31155 __tmp.put_u16_le(self.h_acc);
31156 __tmp.put_u16_le(self.v_acc);
31157 __tmp.put_u16_le(self.vel_acc);
31158 __tmp.put_u16_le(self.update_rate);
31159 for val in &self.uas_id {
31160 __tmp.put_u8(*val);
31161 }
31162 __tmp.put_u8(self.flight_state as u8);
31163 __tmp.put_u8(self.flags.bits());
31164 if matches!(version, MavlinkVersion::V2) {
31165 let len = __tmp.len();
31166 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31167 } else {
31168 __tmp.len()
31169 }
31170 }
31171}
31172#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31173#[doc = ""]
31174#[doc = "ID: 248"]
31175#[derive(Debug, Clone, PartialEq)]
31176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31178#[cfg_attr(feature = "ts", derive(TS))]
31179#[cfg_attr(feature = "ts", ts(export))]
31180pub struct V2_EXTENSION_DATA {
31181 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31182 pub message_type: u16,
31183 #[doc = "Network ID (0 for broadcast)"]
31184 pub target_network: u8,
31185 #[doc = "System ID (0 for broadcast)"]
31186 pub target_system: u8,
31187 #[doc = "Component ID (0 for broadcast)"]
31188 pub target_component: u8,
31189 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31190 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31191 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31192 pub payload: [u8; 249],
31193}
31194impl V2_EXTENSION_DATA {
31195 pub const ENCODED_LEN: usize = 254usize;
31196 pub const DEFAULT: Self = Self {
31197 message_type: 0_u16,
31198 target_network: 0_u8,
31199 target_system: 0_u8,
31200 target_component: 0_u8,
31201 payload: [0_u8; 249usize],
31202 };
31203 #[cfg(feature = "arbitrary")]
31204 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31205 use arbitrary::{Arbitrary, Unstructured};
31206 let mut buf = [0u8; 1024];
31207 rng.fill_bytes(&mut buf);
31208 let mut unstructured = Unstructured::new(&buf);
31209 Self::arbitrary(&mut unstructured).unwrap_or_default()
31210 }
31211}
31212impl Default for V2_EXTENSION_DATA {
31213 fn default() -> Self {
31214 Self::DEFAULT.clone()
31215 }
31216}
31217impl MessageData for V2_EXTENSION_DATA {
31218 type Message = MavMessage;
31219 const ID: u32 = 248u32;
31220 const NAME: &'static str = "V2_EXTENSION";
31221 const EXTRA_CRC: u8 = 8u8;
31222 const ENCODED_LEN: usize = 254usize;
31223 fn deser(
31224 _version: MavlinkVersion,
31225 __input: &[u8],
31226 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31227 let avail_len = __input.len();
31228 let mut payload_buf = [0; Self::ENCODED_LEN];
31229 let mut buf = if avail_len < Self::ENCODED_LEN {
31230 payload_buf[0..avail_len].copy_from_slice(__input);
31231 Bytes::new(&payload_buf)
31232 } else {
31233 Bytes::new(__input)
31234 };
31235 let mut __struct = Self::default();
31236 __struct.message_type = buf.get_u16_le();
31237 __struct.target_network = buf.get_u8();
31238 __struct.target_system = buf.get_u8();
31239 __struct.target_component = buf.get_u8();
31240 for v in &mut __struct.payload {
31241 let val = buf.get_u8();
31242 *v = val;
31243 }
31244 Ok(__struct)
31245 }
31246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31247 let mut __tmp = BytesMut::new(bytes);
31248 #[allow(clippy::absurd_extreme_comparisons)]
31249 #[allow(unused_comparisons)]
31250 if __tmp.remaining() < Self::ENCODED_LEN {
31251 panic!(
31252 "buffer is too small (need {} bytes, but got {})",
31253 Self::ENCODED_LEN,
31254 __tmp.remaining(),
31255 )
31256 }
31257 __tmp.put_u16_le(self.message_type);
31258 __tmp.put_u8(self.target_network);
31259 __tmp.put_u8(self.target_system);
31260 __tmp.put_u8(self.target_component);
31261 for val in &self.payload {
31262 __tmp.put_u8(*val);
31263 }
31264 if matches!(version, MavlinkVersion::V2) {
31265 let len = __tmp.len();
31266 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31267 } else {
31268 __tmp.len()
31269 }
31270 }
31271}
31272#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31273#[doc = ""]
31274#[doc = "ID: 74"]
31275#[derive(Debug, Clone, PartialEq)]
31276#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31277#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31278#[cfg_attr(feature = "ts", derive(TS))]
31279#[cfg_attr(feature = "ts", ts(export))]
31280pub struct VFR_HUD_DATA {
31281 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31282 pub airspeed: f32,
31283 #[doc = "Current ground speed."]
31284 pub groundspeed: f32,
31285 #[doc = "Current altitude (MSL)."]
31286 pub alt: f32,
31287 #[doc = "Current climb rate."]
31288 pub climb: f32,
31289 #[doc = "Current heading in compass units (0-360, 0=north)."]
31290 pub heading: i16,
31291 #[doc = "Current throttle setting (0 to 100)."]
31292 pub throttle: u16,
31293}
31294impl VFR_HUD_DATA {
31295 pub const ENCODED_LEN: usize = 20usize;
31296 pub const DEFAULT: Self = Self {
31297 airspeed: 0.0_f32,
31298 groundspeed: 0.0_f32,
31299 alt: 0.0_f32,
31300 climb: 0.0_f32,
31301 heading: 0_i16,
31302 throttle: 0_u16,
31303 };
31304 #[cfg(feature = "arbitrary")]
31305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31306 use arbitrary::{Arbitrary, Unstructured};
31307 let mut buf = [0u8; 1024];
31308 rng.fill_bytes(&mut buf);
31309 let mut unstructured = Unstructured::new(&buf);
31310 Self::arbitrary(&mut unstructured).unwrap_or_default()
31311 }
31312}
31313impl Default for VFR_HUD_DATA {
31314 fn default() -> Self {
31315 Self::DEFAULT.clone()
31316 }
31317}
31318impl MessageData for VFR_HUD_DATA {
31319 type Message = MavMessage;
31320 const ID: u32 = 74u32;
31321 const NAME: &'static str = "VFR_HUD";
31322 const EXTRA_CRC: u8 = 20u8;
31323 const ENCODED_LEN: usize = 20usize;
31324 fn deser(
31325 _version: MavlinkVersion,
31326 __input: &[u8],
31327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31328 let avail_len = __input.len();
31329 let mut payload_buf = [0; Self::ENCODED_LEN];
31330 let mut buf = if avail_len < Self::ENCODED_LEN {
31331 payload_buf[0..avail_len].copy_from_slice(__input);
31332 Bytes::new(&payload_buf)
31333 } else {
31334 Bytes::new(__input)
31335 };
31336 let mut __struct = Self::default();
31337 __struct.airspeed = buf.get_f32_le();
31338 __struct.groundspeed = buf.get_f32_le();
31339 __struct.alt = buf.get_f32_le();
31340 __struct.climb = buf.get_f32_le();
31341 __struct.heading = buf.get_i16_le();
31342 __struct.throttle = buf.get_u16_le();
31343 Ok(__struct)
31344 }
31345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31346 let mut __tmp = BytesMut::new(bytes);
31347 #[allow(clippy::absurd_extreme_comparisons)]
31348 #[allow(unused_comparisons)]
31349 if __tmp.remaining() < Self::ENCODED_LEN {
31350 panic!(
31351 "buffer is too small (need {} bytes, but got {})",
31352 Self::ENCODED_LEN,
31353 __tmp.remaining(),
31354 )
31355 }
31356 __tmp.put_f32_le(self.airspeed);
31357 __tmp.put_f32_le(self.groundspeed);
31358 __tmp.put_f32_le(self.alt);
31359 __tmp.put_f32_le(self.climb);
31360 __tmp.put_i16_le(self.heading);
31361 __tmp.put_u16_le(self.throttle);
31362 if matches!(version, MavlinkVersion::V2) {
31363 let len = __tmp.len();
31364 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31365 } else {
31366 __tmp.len()
31367 }
31368 }
31369}
31370#[doc = "Vibration levels and accelerometer clipping."]
31371#[doc = ""]
31372#[doc = "ID: 241"]
31373#[derive(Debug, Clone, PartialEq)]
31374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31376#[cfg_attr(feature = "ts", derive(TS))]
31377#[cfg_attr(feature = "ts", ts(export))]
31378pub struct VIBRATION_DATA {
31379 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31380 pub time_usec: u64,
31381 #[doc = "Vibration levels on X-axis"]
31382 pub vibration_x: f32,
31383 #[doc = "Vibration levels on Y-axis"]
31384 pub vibration_y: f32,
31385 #[doc = "Vibration levels on Z-axis"]
31386 pub vibration_z: f32,
31387 #[doc = "first accelerometer clipping count"]
31388 pub clipping_0: u32,
31389 #[doc = "second accelerometer clipping count"]
31390 pub clipping_1: u32,
31391 #[doc = "third accelerometer clipping count"]
31392 pub clipping_2: u32,
31393}
31394impl VIBRATION_DATA {
31395 pub const ENCODED_LEN: usize = 32usize;
31396 pub const DEFAULT: Self = Self {
31397 time_usec: 0_u64,
31398 vibration_x: 0.0_f32,
31399 vibration_y: 0.0_f32,
31400 vibration_z: 0.0_f32,
31401 clipping_0: 0_u32,
31402 clipping_1: 0_u32,
31403 clipping_2: 0_u32,
31404 };
31405 #[cfg(feature = "arbitrary")]
31406 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31407 use arbitrary::{Arbitrary, Unstructured};
31408 let mut buf = [0u8; 1024];
31409 rng.fill_bytes(&mut buf);
31410 let mut unstructured = Unstructured::new(&buf);
31411 Self::arbitrary(&mut unstructured).unwrap_or_default()
31412 }
31413}
31414impl Default for VIBRATION_DATA {
31415 fn default() -> Self {
31416 Self::DEFAULT.clone()
31417 }
31418}
31419impl MessageData for VIBRATION_DATA {
31420 type Message = MavMessage;
31421 const ID: u32 = 241u32;
31422 const NAME: &'static str = "VIBRATION";
31423 const EXTRA_CRC: u8 = 90u8;
31424 const ENCODED_LEN: usize = 32usize;
31425 fn deser(
31426 _version: MavlinkVersion,
31427 __input: &[u8],
31428 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31429 let avail_len = __input.len();
31430 let mut payload_buf = [0; Self::ENCODED_LEN];
31431 let mut buf = if avail_len < Self::ENCODED_LEN {
31432 payload_buf[0..avail_len].copy_from_slice(__input);
31433 Bytes::new(&payload_buf)
31434 } else {
31435 Bytes::new(__input)
31436 };
31437 let mut __struct = Self::default();
31438 __struct.time_usec = buf.get_u64_le();
31439 __struct.vibration_x = buf.get_f32_le();
31440 __struct.vibration_y = buf.get_f32_le();
31441 __struct.vibration_z = buf.get_f32_le();
31442 __struct.clipping_0 = buf.get_u32_le();
31443 __struct.clipping_1 = buf.get_u32_le();
31444 __struct.clipping_2 = buf.get_u32_le();
31445 Ok(__struct)
31446 }
31447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31448 let mut __tmp = BytesMut::new(bytes);
31449 #[allow(clippy::absurd_extreme_comparisons)]
31450 #[allow(unused_comparisons)]
31451 if __tmp.remaining() < Self::ENCODED_LEN {
31452 panic!(
31453 "buffer is too small (need {} bytes, but got {})",
31454 Self::ENCODED_LEN,
31455 __tmp.remaining(),
31456 )
31457 }
31458 __tmp.put_u64_le(self.time_usec);
31459 __tmp.put_f32_le(self.vibration_x);
31460 __tmp.put_f32_le(self.vibration_y);
31461 __tmp.put_f32_le(self.vibration_z);
31462 __tmp.put_u32_le(self.clipping_0);
31463 __tmp.put_u32_le(self.clipping_1);
31464 __tmp.put_u32_le(self.clipping_2);
31465 if matches!(version, MavlinkVersion::V2) {
31466 let len = __tmp.len();
31467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31468 } else {
31469 __tmp.len()
31470 }
31471 }
31472}
31473#[doc = "Global position estimate from a Vicon motion system source."]
31474#[doc = ""]
31475#[doc = "ID: 104"]
31476#[derive(Debug, Clone, PartialEq)]
31477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31479#[cfg_attr(feature = "ts", derive(TS))]
31480#[cfg_attr(feature = "ts", ts(export))]
31481pub struct VICON_POSITION_ESTIMATE_DATA {
31482 #[doc = "Timestamp (UNIX time or time since system boot)"]
31483 pub usec: u64,
31484 #[doc = "Global X position"]
31485 pub x: f32,
31486 #[doc = "Global Y position"]
31487 pub y: f32,
31488 #[doc = "Global Z position"]
31489 pub z: f32,
31490 #[doc = "Roll angle"]
31491 pub roll: f32,
31492 #[doc = "Pitch angle"]
31493 pub pitch: f32,
31494 #[doc = "Yaw angle"]
31495 pub yaw: f32,
31496 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31497 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31499 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31500 pub covariance: [f32; 21],
31501}
31502impl VICON_POSITION_ESTIMATE_DATA {
31503 pub const ENCODED_LEN: usize = 116usize;
31504 pub const DEFAULT: Self = Self {
31505 usec: 0_u64,
31506 x: 0.0_f32,
31507 y: 0.0_f32,
31508 z: 0.0_f32,
31509 roll: 0.0_f32,
31510 pitch: 0.0_f32,
31511 yaw: 0.0_f32,
31512 covariance: [0.0_f32; 21usize],
31513 };
31514 #[cfg(feature = "arbitrary")]
31515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31516 use arbitrary::{Arbitrary, Unstructured};
31517 let mut buf = [0u8; 1024];
31518 rng.fill_bytes(&mut buf);
31519 let mut unstructured = Unstructured::new(&buf);
31520 Self::arbitrary(&mut unstructured).unwrap_or_default()
31521 }
31522}
31523impl Default for VICON_POSITION_ESTIMATE_DATA {
31524 fn default() -> Self {
31525 Self::DEFAULT.clone()
31526 }
31527}
31528impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31529 type Message = MavMessage;
31530 const ID: u32 = 104u32;
31531 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31532 const EXTRA_CRC: u8 = 56u8;
31533 const ENCODED_LEN: usize = 116usize;
31534 fn deser(
31535 _version: MavlinkVersion,
31536 __input: &[u8],
31537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31538 let avail_len = __input.len();
31539 let mut payload_buf = [0; Self::ENCODED_LEN];
31540 let mut buf = if avail_len < Self::ENCODED_LEN {
31541 payload_buf[0..avail_len].copy_from_slice(__input);
31542 Bytes::new(&payload_buf)
31543 } else {
31544 Bytes::new(__input)
31545 };
31546 let mut __struct = Self::default();
31547 __struct.usec = buf.get_u64_le();
31548 __struct.x = buf.get_f32_le();
31549 __struct.y = buf.get_f32_le();
31550 __struct.z = buf.get_f32_le();
31551 __struct.roll = buf.get_f32_le();
31552 __struct.pitch = buf.get_f32_le();
31553 __struct.yaw = buf.get_f32_le();
31554 for v in &mut __struct.covariance {
31555 let val = buf.get_f32_le();
31556 *v = val;
31557 }
31558 Ok(__struct)
31559 }
31560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31561 let mut __tmp = BytesMut::new(bytes);
31562 #[allow(clippy::absurd_extreme_comparisons)]
31563 #[allow(unused_comparisons)]
31564 if __tmp.remaining() < Self::ENCODED_LEN {
31565 panic!(
31566 "buffer is too small (need {} bytes, but got {})",
31567 Self::ENCODED_LEN,
31568 __tmp.remaining(),
31569 )
31570 }
31571 __tmp.put_u64_le(self.usec);
31572 __tmp.put_f32_le(self.x);
31573 __tmp.put_f32_le(self.y);
31574 __tmp.put_f32_le(self.z);
31575 __tmp.put_f32_le(self.roll);
31576 __tmp.put_f32_le(self.pitch);
31577 __tmp.put_f32_le(self.yaw);
31578 if matches!(version, MavlinkVersion::V2) {
31579 for val in &self.covariance {
31580 __tmp.put_f32_le(*val);
31581 }
31582 let len = __tmp.len();
31583 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31584 } else {
31585 __tmp.len()
31586 }
31587 }
31588}
31589#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31590#[doc = ""]
31591#[doc = "ID: 269"]
31592#[derive(Debug, Clone, PartialEq)]
31593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31594#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31595#[cfg_attr(feature = "ts", derive(TS))]
31596#[cfg_attr(feature = "ts", ts(export))]
31597pub struct VIDEO_STREAM_INFORMATION_DATA {
31598 #[doc = "Frame rate."]
31599 pub framerate: f32,
31600 #[doc = "Bit rate."]
31601 pub bitrate: u32,
31602 #[doc = "Bitmap of stream status flags."]
31603 pub flags: VideoStreamStatusFlags,
31604 #[doc = "Horizontal resolution."]
31605 pub resolution_h: u16,
31606 #[doc = "Vertical resolution."]
31607 pub resolution_v: u16,
31608 #[doc = "Video image rotation clockwise."]
31609 pub rotation: u16,
31610 #[doc = "Horizontal Field of view."]
31611 pub hfov: u16,
31612 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31613 pub stream_id: u8,
31614 #[doc = "Number of streams available."]
31615 pub count: u8,
31616 #[doc = "Type of stream."]
31617 pub mavtype: VideoStreamType,
31618 #[doc = "Stream name."]
31619 #[cfg_attr(feature = "ts", ts(type = "string"))]
31620 pub name: CharArray<32>,
31621 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31622 #[cfg_attr(feature = "ts", ts(type = "string"))]
31623 pub uri: CharArray<160>,
31624 #[doc = "Encoding of stream."]
31625 #[cfg_attr(feature = "serde", serde(default))]
31626 pub encoding: VideoStreamEncoding,
31627 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31628 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31629 pub camera_device_id: u8,
31630}
31631impl VIDEO_STREAM_INFORMATION_DATA {
31632 pub const ENCODED_LEN: usize = 215usize;
31633 pub const DEFAULT: Self = Self {
31634 framerate: 0.0_f32,
31635 bitrate: 0_u32,
31636 flags: VideoStreamStatusFlags::DEFAULT,
31637 resolution_h: 0_u16,
31638 resolution_v: 0_u16,
31639 rotation: 0_u16,
31640 hfov: 0_u16,
31641 stream_id: 0_u8,
31642 count: 0_u8,
31643 mavtype: VideoStreamType::DEFAULT,
31644 name: CharArray::new([0_u8; 32usize]),
31645 uri: CharArray::new([0_u8; 160usize]),
31646 encoding: VideoStreamEncoding::DEFAULT,
31647 camera_device_id: 0_u8,
31648 };
31649 #[cfg(feature = "arbitrary")]
31650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31651 use arbitrary::{Arbitrary, Unstructured};
31652 let mut buf = [0u8; 1024];
31653 rng.fill_bytes(&mut buf);
31654 let mut unstructured = Unstructured::new(&buf);
31655 Self::arbitrary(&mut unstructured).unwrap_or_default()
31656 }
31657}
31658impl Default for VIDEO_STREAM_INFORMATION_DATA {
31659 fn default() -> Self {
31660 Self::DEFAULT.clone()
31661 }
31662}
31663impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31664 type Message = MavMessage;
31665 const ID: u32 = 269u32;
31666 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31667 const EXTRA_CRC: u8 = 109u8;
31668 const ENCODED_LEN: usize = 215usize;
31669 fn deser(
31670 _version: MavlinkVersion,
31671 __input: &[u8],
31672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31673 let avail_len = __input.len();
31674 let mut payload_buf = [0; Self::ENCODED_LEN];
31675 let mut buf = if avail_len < Self::ENCODED_LEN {
31676 payload_buf[0..avail_len].copy_from_slice(__input);
31677 Bytes::new(&payload_buf)
31678 } else {
31679 Bytes::new(__input)
31680 };
31681 let mut __struct = Self::default();
31682 __struct.framerate = buf.get_f32_le();
31683 __struct.bitrate = buf.get_u32_le();
31684 let tmp = buf.get_u16_le();
31685 __struct.flags = VideoStreamStatusFlags::from_bits(
31686 tmp & VideoStreamStatusFlags::all().bits(),
31687 )
31688 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31689 flag_type: "VideoStreamStatusFlags",
31690 value: tmp as u32,
31691 })?;
31692 __struct.resolution_h = buf.get_u16_le();
31693 __struct.resolution_v = buf.get_u16_le();
31694 __struct.rotation = buf.get_u16_le();
31695 __struct.hfov = buf.get_u16_le();
31696 __struct.stream_id = buf.get_u8();
31697 __struct.count = buf.get_u8();
31698 let tmp = buf.get_u8();
31699 __struct.mavtype =
31700 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31701 enum_type: "VideoStreamType",
31702 value: tmp as u32,
31703 })?;
31704 let mut tmp = [0_u8; 32usize];
31705 for v in &mut tmp {
31706 *v = buf.get_u8();
31707 }
31708 __struct.name = CharArray::new(tmp);
31709 let mut tmp = [0_u8; 160usize];
31710 for v in &mut tmp {
31711 *v = buf.get_u8();
31712 }
31713 __struct.uri = CharArray::new(tmp);
31714 let tmp = buf.get_u8();
31715 __struct.encoding =
31716 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31717 enum_type: "VideoStreamEncoding",
31718 value: tmp as u32,
31719 })?;
31720 __struct.camera_device_id = buf.get_u8();
31721 Ok(__struct)
31722 }
31723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31724 let mut __tmp = BytesMut::new(bytes);
31725 #[allow(clippy::absurd_extreme_comparisons)]
31726 #[allow(unused_comparisons)]
31727 if __tmp.remaining() < Self::ENCODED_LEN {
31728 panic!(
31729 "buffer is too small (need {} bytes, but got {})",
31730 Self::ENCODED_LEN,
31731 __tmp.remaining(),
31732 )
31733 }
31734 __tmp.put_f32_le(self.framerate);
31735 __tmp.put_u32_le(self.bitrate);
31736 __tmp.put_u16_le(self.flags.bits());
31737 __tmp.put_u16_le(self.resolution_h);
31738 __tmp.put_u16_le(self.resolution_v);
31739 __tmp.put_u16_le(self.rotation);
31740 __tmp.put_u16_le(self.hfov);
31741 __tmp.put_u8(self.stream_id);
31742 __tmp.put_u8(self.count);
31743 __tmp.put_u8(self.mavtype as u8);
31744 for val in &self.name {
31745 __tmp.put_u8(*val);
31746 }
31747 for val in &self.uri {
31748 __tmp.put_u8(*val);
31749 }
31750 if matches!(version, MavlinkVersion::V2) {
31751 __tmp.put_u8(self.encoding as u8);
31752 __tmp.put_u8(self.camera_device_id);
31753 let len = __tmp.len();
31754 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31755 } else {
31756 __tmp.len()
31757 }
31758 }
31759}
31760#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
31761#[doc = ""]
31762#[doc = "ID: 270"]
31763#[derive(Debug, Clone, PartialEq)]
31764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31766#[cfg_attr(feature = "ts", derive(TS))]
31767#[cfg_attr(feature = "ts", ts(export))]
31768pub struct VIDEO_STREAM_STATUS_DATA {
31769 #[doc = "Frame rate"]
31770 pub framerate: f32,
31771 #[doc = "Bit rate"]
31772 pub bitrate: u32,
31773 #[doc = "Bitmap of stream status flags"]
31774 pub flags: VideoStreamStatusFlags,
31775 #[doc = "Horizontal resolution"]
31776 pub resolution_h: u16,
31777 #[doc = "Vertical resolution"]
31778 pub resolution_v: u16,
31779 #[doc = "Video image rotation clockwise"]
31780 pub rotation: u16,
31781 #[doc = "Horizontal Field of view"]
31782 pub hfov: u16,
31783 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31784 pub stream_id: u8,
31785 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31786 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31787 pub camera_device_id: u8,
31788}
31789impl VIDEO_STREAM_STATUS_DATA {
31790 pub const ENCODED_LEN: usize = 20usize;
31791 pub const DEFAULT: Self = Self {
31792 framerate: 0.0_f32,
31793 bitrate: 0_u32,
31794 flags: VideoStreamStatusFlags::DEFAULT,
31795 resolution_h: 0_u16,
31796 resolution_v: 0_u16,
31797 rotation: 0_u16,
31798 hfov: 0_u16,
31799 stream_id: 0_u8,
31800 camera_device_id: 0_u8,
31801 };
31802 #[cfg(feature = "arbitrary")]
31803 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31804 use arbitrary::{Arbitrary, Unstructured};
31805 let mut buf = [0u8; 1024];
31806 rng.fill_bytes(&mut buf);
31807 let mut unstructured = Unstructured::new(&buf);
31808 Self::arbitrary(&mut unstructured).unwrap_or_default()
31809 }
31810}
31811impl Default for VIDEO_STREAM_STATUS_DATA {
31812 fn default() -> Self {
31813 Self::DEFAULT.clone()
31814 }
31815}
31816impl MessageData for VIDEO_STREAM_STATUS_DATA {
31817 type Message = MavMessage;
31818 const ID: u32 = 270u32;
31819 const NAME: &'static str = "VIDEO_STREAM_STATUS";
31820 const EXTRA_CRC: u8 = 59u8;
31821 const ENCODED_LEN: usize = 20usize;
31822 fn deser(
31823 _version: MavlinkVersion,
31824 __input: &[u8],
31825 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31826 let avail_len = __input.len();
31827 let mut payload_buf = [0; Self::ENCODED_LEN];
31828 let mut buf = if avail_len < Self::ENCODED_LEN {
31829 payload_buf[0..avail_len].copy_from_slice(__input);
31830 Bytes::new(&payload_buf)
31831 } else {
31832 Bytes::new(__input)
31833 };
31834 let mut __struct = Self::default();
31835 __struct.framerate = buf.get_f32_le();
31836 __struct.bitrate = buf.get_u32_le();
31837 let tmp = buf.get_u16_le();
31838 __struct.flags = VideoStreamStatusFlags::from_bits(
31839 tmp & VideoStreamStatusFlags::all().bits(),
31840 )
31841 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31842 flag_type: "VideoStreamStatusFlags",
31843 value: tmp as u32,
31844 })?;
31845 __struct.resolution_h = buf.get_u16_le();
31846 __struct.resolution_v = buf.get_u16_le();
31847 __struct.rotation = buf.get_u16_le();
31848 __struct.hfov = buf.get_u16_le();
31849 __struct.stream_id = buf.get_u8();
31850 __struct.camera_device_id = buf.get_u8();
31851 Ok(__struct)
31852 }
31853 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31854 let mut __tmp = BytesMut::new(bytes);
31855 #[allow(clippy::absurd_extreme_comparisons)]
31856 #[allow(unused_comparisons)]
31857 if __tmp.remaining() < Self::ENCODED_LEN {
31858 panic!(
31859 "buffer is too small (need {} bytes, but got {})",
31860 Self::ENCODED_LEN,
31861 __tmp.remaining(),
31862 )
31863 }
31864 __tmp.put_f32_le(self.framerate);
31865 __tmp.put_u32_le(self.bitrate);
31866 __tmp.put_u16_le(self.flags.bits());
31867 __tmp.put_u16_le(self.resolution_h);
31868 __tmp.put_u16_le(self.resolution_v);
31869 __tmp.put_u16_le(self.rotation);
31870 __tmp.put_u16_le(self.hfov);
31871 __tmp.put_u8(self.stream_id);
31872 if matches!(version, MavlinkVersion::V2) {
31873 __tmp.put_u8(self.camera_device_id);
31874 let len = __tmp.len();
31875 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31876 } else {
31877 __tmp.len()
31878 }
31879 }
31880}
31881#[doc = "Local position/attitude estimate from a vision source."]
31882#[doc = ""]
31883#[doc = "ID: 102"]
31884#[derive(Debug, Clone, PartialEq)]
31885#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31887#[cfg_attr(feature = "ts", derive(TS))]
31888#[cfg_attr(feature = "ts", ts(export))]
31889pub struct VISION_POSITION_ESTIMATE_DATA {
31890 #[doc = "Timestamp (UNIX time or time since system boot)"]
31891 pub usec: u64,
31892 #[doc = "Local X position"]
31893 pub x: f32,
31894 #[doc = "Local Y position"]
31895 pub y: f32,
31896 #[doc = "Local Z position"]
31897 pub z: f32,
31898 #[doc = "Roll angle"]
31899 pub roll: f32,
31900 #[doc = "Pitch angle"]
31901 pub pitch: f32,
31902 #[doc = "Yaw angle"]
31903 pub yaw: f32,
31904 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31905 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31906 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31907 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31908 pub covariance: [f32; 21],
31909 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31910 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31911 pub reset_counter: u8,
31912}
31913impl VISION_POSITION_ESTIMATE_DATA {
31914 pub const ENCODED_LEN: usize = 117usize;
31915 pub const DEFAULT: Self = Self {
31916 usec: 0_u64,
31917 x: 0.0_f32,
31918 y: 0.0_f32,
31919 z: 0.0_f32,
31920 roll: 0.0_f32,
31921 pitch: 0.0_f32,
31922 yaw: 0.0_f32,
31923 covariance: [0.0_f32; 21usize],
31924 reset_counter: 0_u8,
31925 };
31926 #[cfg(feature = "arbitrary")]
31927 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31928 use arbitrary::{Arbitrary, Unstructured};
31929 let mut buf = [0u8; 1024];
31930 rng.fill_bytes(&mut buf);
31931 let mut unstructured = Unstructured::new(&buf);
31932 Self::arbitrary(&mut unstructured).unwrap_or_default()
31933 }
31934}
31935impl Default for VISION_POSITION_ESTIMATE_DATA {
31936 fn default() -> Self {
31937 Self::DEFAULT.clone()
31938 }
31939}
31940impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31941 type Message = MavMessage;
31942 const ID: u32 = 102u32;
31943 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31944 const EXTRA_CRC: u8 = 158u8;
31945 const ENCODED_LEN: usize = 117usize;
31946 fn deser(
31947 _version: MavlinkVersion,
31948 __input: &[u8],
31949 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31950 let avail_len = __input.len();
31951 let mut payload_buf = [0; Self::ENCODED_LEN];
31952 let mut buf = if avail_len < Self::ENCODED_LEN {
31953 payload_buf[0..avail_len].copy_from_slice(__input);
31954 Bytes::new(&payload_buf)
31955 } else {
31956 Bytes::new(__input)
31957 };
31958 let mut __struct = Self::default();
31959 __struct.usec = buf.get_u64_le();
31960 __struct.x = buf.get_f32_le();
31961 __struct.y = buf.get_f32_le();
31962 __struct.z = buf.get_f32_le();
31963 __struct.roll = buf.get_f32_le();
31964 __struct.pitch = buf.get_f32_le();
31965 __struct.yaw = buf.get_f32_le();
31966 for v in &mut __struct.covariance {
31967 let val = buf.get_f32_le();
31968 *v = val;
31969 }
31970 __struct.reset_counter = buf.get_u8();
31971 Ok(__struct)
31972 }
31973 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31974 let mut __tmp = BytesMut::new(bytes);
31975 #[allow(clippy::absurd_extreme_comparisons)]
31976 #[allow(unused_comparisons)]
31977 if __tmp.remaining() < Self::ENCODED_LEN {
31978 panic!(
31979 "buffer is too small (need {} bytes, but got {})",
31980 Self::ENCODED_LEN,
31981 __tmp.remaining(),
31982 )
31983 }
31984 __tmp.put_u64_le(self.usec);
31985 __tmp.put_f32_le(self.x);
31986 __tmp.put_f32_le(self.y);
31987 __tmp.put_f32_le(self.z);
31988 __tmp.put_f32_le(self.roll);
31989 __tmp.put_f32_le(self.pitch);
31990 __tmp.put_f32_le(self.yaw);
31991 if matches!(version, MavlinkVersion::V2) {
31992 for val in &self.covariance {
31993 __tmp.put_f32_le(*val);
31994 }
31995 __tmp.put_u8(self.reset_counter);
31996 let len = __tmp.len();
31997 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31998 } else {
31999 __tmp.len()
32000 }
32001 }
32002}
32003#[doc = "Speed estimate from a vision source."]
32004#[doc = ""]
32005#[doc = "ID: 103"]
32006#[derive(Debug, Clone, PartialEq)]
32007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32009#[cfg_attr(feature = "ts", derive(TS))]
32010#[cfg_attr(feature = "ts", ts(export))]
32011pub struct VISION_SPEED_ESTIMATE_DATA {
32012 #[doc = "Timestamp (UNIX time or time since system boot)"]
32013 pub usec: u64,
32014 #[doc = "Global X speed"]
32015 pub x: f32,
32016 #[doc = "Global Y speed"]
32017 pub y: f32,
32018 #[doc = "Global Z speed"]
32019 pub z: f32,
32020 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
32021 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32022 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32023 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32024 pub covariance: [f32; 9],
32025 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32026 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32027 pub reset_counter: u8,
32028}
32029impl VISION_SPEED_ESTIMATE_DATA {
32030 pub const ENCODED_LEN: usize = 57usize;
32031 pub const DEFAULT: Self = Self {
32032 usec: 0_u64,
32033 x: 0.0_f32,
32034 y: 0.0_f32,
32035 z: 0.0_f32,
32036 covariance: [0.0_f32; 9usize],
32037 reset_counter: 0_u8,
32038 };
32039 #[cfg(feature = "arbitrary")]
32040 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32041 use arbitrary::{Arbitrary, Unstructured};
32042 let mut buf = [0u8; 1024];
32043 rng.fill_bytes(&mut buf);
32044 let mut unstructured = Unstructured::new(&buf);
32045 Self::arbitrary(&mut unstructured).unwrap_or_default()
32046 }
32047}
32048impl Default for VISION_SPEED_ESTIMATE_DATA {
32049 fn default() -> Self {
32050 Self::DEFAULT.clone()
32051 }
32052}
32053impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32054 type Message = MavMessage;
32055 const ID: u32 = 103u32;
32056 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32057 const EXTRA_CRC: u8 = 208u8;
32058 const ENCODED_LEN: usize = 57usize;
32059 fn deser(
32060 _version: MavlinkVersion,
32061 __input: &[u8],
32062 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32063 let avail_len = __input.len();
32064 let mut payload_buf = [0; Self::ENCODED_LEN];
32065 let mut buf = if avail_len < Self::ENCODED_LEN {
32066 payload_buf[0..avail_len].copy_from_slice(__input);
32067 Bytes::new(&payload_buf)
32068 } else {
32069 Bytes::new(__input)
32070 };
32071 let mut __struct = Self::default();
32072 __struct.usec = buf.get_u64_le();
32073 __struct.x = buf.get_f32_le();
32074 __struct.y = buf.get_f32_le();
32075 __struct.z = buf.get_f32_le();
32076 for v in &mut __struct.covariance {
32077 let val = buf.get_f32_le();
32078 *v = val;
32079 }
32080 __struct.reset_counter = buf.get_u8();
32081 Ok(__struct)
32082 }
32083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32084 let mut __tmp = BytesMut::new(bytes);
32085 #[allow(clippy::absurd_extreme_comparisons)]
32086 #[allow(unused_comparisons)]
32087 if __tmp.remaining() < Self::ENCODED_LEN {
32088 panic!(
32089 "buffer is too small (need {} bytes, but got {})",
32090 Self::ENCODED_LEN,
32091 __tmp.remaining(),
32092 )
32093 }
32094 __tmp.put_u64_le(self.usec);
32095 __tmp.put_f32_le(self.x);
32096 __tmp.put_f32_le(self.y);
32097 __tmp.put_f32_le(self.z);
32098 if matches!(version, MavlinkVersion::V2) {
32099 for val in &self.covariance {
32100 __tmp.put_f32_le(*val);
32101 }
32102 __tmp.put_u8(self.reset_counter);
32103 let len = __tmp.len();
32104 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32105 } else {
32106 __tmp.len()
32107 }
32108 }
32109}
32110#[doc = "Cumulative distance traveled for each reported wheel."]
32111#[doc = ""]
32112#[doc = "ID: 9000"]
32113#[derive(Debug, Clone, PartialEq)]
32114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32116#[cfg_attr(feature = "ts", derive(TS))]
32117#[cfg_attr(feature = "ts", ts(export))]
32118pub struct WHEEL_DISTANCE_DATA {
32119 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32120 pub time_usec: u64,
32121 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32122 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32123 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32124 pub distance: [f64; 16],
32125 #[doc = "Number of wheels reported."]
32126 pub count: u8,
32127}
32128impl WHEEL_DISTANCE_DATA {
32129 pub const ENCODED_LEN: usize = 137usize;
32130 pub const DEFAULT: Self = Self {
32131 time_usec: 0_u64,
32132 distance: [0.0_f64; 16usize],
32133 count: 0_u8,
32134 };
32135 #[cfg(feature = "arbitrary")]
32136 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32137 use arbitrary::{Arbitrary, Unstructured};
32138 let mut buf = [0u8; 1024];
32139 rng.fill_bytes(&mut buf);
32140 let mut unstructured = Unstructured::new(&buf);
32141 Self::arbitrary(&mut unstructured).unwrap_or_default()
32142 }
32143}
32144impl Default for WHEEL_DISTANCE_DATA {
32145 fn default() -> Self {
32146 Self::DEFAULT.clone()
32147 }
32148}
32149impl MessageData for WHEEL_DISTANCE_DATA {
32150 type Message = MavMessage;
32151 const ID: u32 = 9000u32;
32152 const NAME: &'static str = "WHEEL_DISTANCE";
32153 const EXTRA_CRC: u8 = 113u8;
32154 const ENCODED_LEN: usize = 137usize;
32155 fn deser(
32156 _version: MavlinkVersion,
32157 __input: &[u8],
32158 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32159 let avail_len = __input.len();
32160 let mut payload_buf = [0; Self::ENCODED_LEN];
32161 let mut buf = if avail_len < Self::ENCODED_LEN {
32162 payload_buf[0..avail_len].copy_from_slice(__input);
32163 Bytes::new(&payload_buf)
32164 } else {
32165 Bytes::new(__input)
32166 };
32167 let mut __struct = Self::default();
32168 __struct.time_usec = buf.get_u64_le();
32169 for v in &mut __struct.distance {
32170 let val = buf.get_f64_le();
32171 *v = val;
32172 }
32173 __struct.count = buf.get_u8();
32174 Ok(__struct)
32175 }
32176 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32177 let mut __tmp = BytesMut::new(bytes);
32178 #[allow(clippy::absurd_extreme_comparisons)]
32179 #[allow(unused_comparisons)]
32180 if __tmp.remaining() < Self::ENCODED_LEN {
32181 panic!(
32182 "buffer is too small (need {} bytes, but got {})",
32183 Self::ENCODED_LEN,
32184 __tmp.remaining(),
32185 )
32186 }
32187 __tmp.put_u64_le(self.time_usec);
32188 for val in &self.distance {
32189 __tmp.put_f64_le(*val);
32190 }
32191 __tmp.put_u8(self.count);
32192 if matches!(version, MavlinkVersion::V2) {
32193 let len = __tmp.len();
32194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32195 } else {
32196 __tmp.len()
32197 }
32198 }
32199}
32200#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32201#[doc = ""]
32202#[doc = "ID: 299"]
32203#[derive(Debug, Clone, PartialEq)]
32204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32206#[cfg_attr(feature = "ts", derive(TS))]
32207#[cfg_attr(feature = "ts", ts(export))]
32208pub struct WIFI_CONFIG_AP_DATA {
32209 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32210 #[cfg_attr(feature = "ts", ts(type = "string"))]
32211 pub ssid: CharArray<32>,
32212 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32213 #[cfg_attr(feature = "ts", ts(type = "string"))]
32214 pub password: CharArray<64>,
32215 #[doc = "WiFi Mode."]
32216 #[cfg_attr(feature = "serde", serde(default))]
32217 pub mode: WifiConfigApMode,
32218 #[doc = "Message acceptance response (sent back to GS)."]
32219 #[cfg_attr(feature = "serde", serde(default))]
32220 pub response: WifiConfigApResponse,
32221}
32222impl WIFI_CONFIG_AP_DATA {
32223 pub const ENCODED_LEN: usize = 98usize;
32224 pub const DEFAULT: Self = Self {
32225 ssid: CharArray::new([0_u8; 32usize]),
32226 password: CharArray::new([0_u8; 64usize]),
32227 mode: WifiConfigApMode::DEFAULT,
32228 response: WifiConfigApResponse::DEFAULT,
32229 };
32230 #[cfg(feature = "arbitrary")]
32231 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32232 use arbitrary::{Arbitrary, Unstructured};
32233 let mut buf = [0u8; 1024];
32234 rng.fill_bytes(&mut buf);
32235 let mut unstructured = Unstructured::new(&buf);
32236 Self::arbitrary(&mut unstructured).unwrap_or_default()
32237 }
32238}
32239impl Default for WIFI_CONFIG_AP_DATA {
32240 fn default() -> Self {
32241 Self::DEFAULT.clone()
32242 }
32243}
32244impl MessageData for WIFI_CONFIG_AP_DATA {
32245 type Message = MavMessage;
32246 const ID: u32 = 299u32;
32247 const NAME: &'static str = "WIFI_CONFIG_AP";
32248 const EXTRA_CRC: u8 = 19u8;
32249 const ENCODED_LEN: usize = 98usize;
32250 fn deser(
32251 _version: MavlinkVersion,
32252 __input: &[u8],
32253 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32254 let avail_len = __input.len();
32255 let mut payload_buf = [0; Self::ENCODED_LEN];
32256 let mut buf = if avail_len < Self::ENCODED_LEN {
32257 payload_buf[0..avail_len].copy_from_slice(__input);
32258 Bytes::new(&payload_buf)
32259 } else {
32260 Bytes::new(__input)
32261 };
32262 let mut __struct = Self::default();
32263 let mut tmp = [0_u8; 32usize];
32264 for v in &mut tmp {
32265 *v = buf.get_u8();
32266 }
32267 __struct.ssid = CharArray::new(tmp);
32268 let mut tmp = [0_u8; 64usize];
32269 for v in &mut tmp {
32270 *v = buf.get_u8();
32271 }
32272 __struct.password = CharArray::new(tmp);
32273 let tmp = buf.get_i8();
32274 __struct.mode =
32275 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32276 enum_type: "WifiConfigApMode",
32277 value: tmp as u32,
32278 })?;
32279 let tmp = buf.get_i8();
32280 __struct.response =
32281 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32282 enum_type: "WifiConfigApResponse",
32283 value: tmp as u32,
32284 })?;
32285 Ok(__struct)
32286 }
32287 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32288 let mut __tmp = BytesMut::new(bytes);
32289 #[allow(clippy::absurd_extreme_comparisons)]
32290 #[allow(unused_comparisons)]
32291 if __tmp.remaining() < Self::ENCODED_LEN {
32292 panic!(
32293 "buffer is too small (need {} bytes, but got {})",
32294 Self::ENCODED_LEN,
32295 __tmp.remaining(),
32296 )
32297 }
32298 for val in &self.ssid {
32299 __tmp.put_u8(*val);
32300 }
32301 for val in &self.password {
32302 __tmp.put_u8(*val);
32303 }
32304 if matches!(version, MavlinkVersion::V2) {
32305 __tmp.put_i8(self.mode as i8);
32306 __tmp.put_i8(self.response as i8);
32307 let len = __tmp.len();
32308 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32309 } else {
32310 __tmp.len()
32311 }
32312 }
32313}
32314#[doc = "Winch status."]
32315#[doc = ""]
32316#[doc = "ID: 9005"]
32317#[derive(Debug, Clone, PartialEq)]
32318#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32319#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32320#[cfg_attr(feature = "ts", derive(TS))]
32321#[cfg_attr(feature = "ts", ts(export))]
32322pub struct WINCH_STATUS_DATA {
32323 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32324 pub time_usec: u64,
32325 #[doc = "Length of line released. NaN if unknown"]
32326 pub line_length: f32,
32327 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32328 pub speed: f32,
32329 #[doc = "Tension on the line. NaN if unknown"]
32330 pub tension: f32,
32331 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32332 pub voltage: f32,
32333 #[doc = "Current draw from the winch. NaN if unknown"]
32334 pub current: f32,
32335 #[doc = "Status flags"]
32336 pub status: MavWinchStatusFlag,
32337 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32338 pub temperature: i16,
32339}
32340impl WINCH_STATUS_DATA {
32341 pub const ENCODED_LEN: usize = 34usize;
32342 pub const DEFAULT: Self = Self {
32343 time_usec: 0_u64,
32344 line_length: 0.0_f32,
32345 speed: 0.0_f32,
32346 tension: 0.0_f32,
32347 voltage: 0.0_f32,
32348 current: 0.0_f32,
32349 status: MavWinchStatusFlag::DEFAULT,
32350 temperature: 0_i16,
32351 };
32352 #[cfg(feature = "arbitrary")]
32353 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32354 use arbitrary::{Arbitrary, Unstructured};
32355 let mut buf = [0u8; 1024];
32356 rng.fill_bytes(&mut buf);
32357 let mut unstructured = Unstructured::new(&buf);
32358 Self::arbitrary(&mut unstructured).unwrap_or_default()
32359 }
32360}
32361impl Default for WINCH_STATUS_DATA {
32362 fn default() -> Self {
32363 Self::DEFAULT.clone()
32364 }
32365}
32366impl MessageData for WINCH_STATUS_DATA {
32367 type Message = MavMessage;
32368 const ID: u32 = 9005u32;
32369 const NAME: &'static str = "WINCH_STATUS";
32370 const EXTRA_CRC: u8 = 117u8;
32371 const ENCODED_LEN: usize = 34usize;
32372 fn deser(
32373 _version: MavlinkVersion,
32374 __input: &[u8],
32375 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32376 let avail_len = __input.len();
32377 let mut payload_buf = [0; Self::ENCODED_LEN];
32378 let mut buf = if avail_len < Self::ENCODED_LEN {
32379 payload_buf[0..avail_len].copy_from_slice(__input);
32380 Bytes::new(&payload_buf)
32381 } else {
32382 Bytes::new(__input)
32383 };
32384 let mut __struct = Self::default();
32385 __struct.time_usec = buf.get_u64_le();
32386 __struct.line_length = buf.get_f32_le();
32387 __struct.speed = buf.get_f32_le();
32388 __struct.tension = buf.get_f32_le();
32389 __struct.voltage = buf.get_f32_le();
32390 __struct.current = buf.get_f32_le();
32391 let tmp = buf.get_u32_le();
32392 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
32393 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32394 flag_type: "MavWinchStatusFlag",
32395 value: tmp as u32,
32396 })?;
32397 __struct.temperature = buf.get_i16_le();
32398 Ok(__struct)
32399 }
32400 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32401 let mut __tmp = BytesMut::new(bytes);
32402 #[allow(clippy::absurd_extreme_comparisons)]
32403 #[allow(unused_comparisons)]
32404 if __tmp.remaining() < Self::ENCODED_LEN {
32405 panic!(
32406 "buffer is too small (need {} bytes, but got {})",
32407 Self::ENCODED_LEN,
32408 __tmp.remaining(),
32409 )
32410 }
32411 __tmp.put_u64_le(self.time_usec);
32412 __tmp.put_f32_le(self.line_length);
32413 __tmp.put_f32_le(self.speed);
32414 __tmp.put_f32_le(self.tension);
32415 __tmp.put_f32_le(self.voltage);
32416 __tmp.put_f32_le(self.current);
32417 __tmp.put_u32_le(self.status.bits());
32418 __tmp.put_i16_le(self.temperature);
32419 if matches!(version, MavlinkVersion::V2) {
32420 let len = __tmp.len();
32421 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32422 } else {
32423 __tmp.len()
32424 }
32425 }
32426}
32427#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32428#[doc = ""]
32429#[doc = "ID: 231"]
32430#[derive(Debug, Clone, PartialEq)]
32431#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32433#[cfg_attr(feature = "ts", derive(TS))]
32434#[cfg_attr(feature = "ts", ts(export))]
32435pub struct WIND_COV_DATA {
32436 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32437 pub time_usec: u64,
32438 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32439 pub wind_x: f32,
32440 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32441 pub wind_y: f32,
32442 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32443 pub wind_z: f32,
32444 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32445 pub var_horiz: f32,
32446 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32447 pub var_vert: f32,
32448 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32449 pub wind_alt: f32,
32450 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32451 pub horiz_accuracy: f32,
32452 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32453 pub vert_accuracy: f32,
32454}
32455impl WIND_COV_DATA {
32456 pub const ENCODED_LEN: usize = 40usize;
32457 pub const DEFAULT: Self = Self {
32458 time_usec: 0_u64,
32459 wind_x: 0.0_f32,
32460 wind_y: 0.0_f32,
32461 wind_z: 0.0_f32,
32462 var_horiz: 0.0_f32,
32463 var_vert: 0.0_f32,
32464 wind_alt: 0.0_f32,
32465 horiz_accuracy: 0.0_f32,
32466 vert_accuracy: 0.0_f32,
32467 };
32468 #[cfg(feature = "arbitrary")]
32469 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32470 use arbitrary::{Arbitrary, Unstructured};
32471 let mut buf = [0u8; 1024];
32472 rng.fill_bytes(&mut buf);
32473 let mut unstructured = Unstructured::new(&buf);
32474 Self::arbitrary(&mut unstructured).unwrap_or_default()
32475 }
32476}
32477impl Default for WIND_COV_DATA {
32478 fn default() -> Self {
32479 Self::DEFAULT.clone()
32480 }
32481}
32482impl MessageData for WIND_COV_DATA {
32483 type Message = MavMessage;
32484 const ID: u32 = 231u32;
32485 const NAME: &'static str = "WIND_COV";
32486 const EXTRA_CRC: u8 = 105u8;
32487 const ENCODED_LEN: usize = 40usize;
32488 fn deser(
32489 _version: MavlinkVersion,
32490 __input: &[u8],
32491 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32492 let avail_len = __input.len();
32493 let mut payload_buf = [0; Self::ENCODED_LEN];
32494 let mut buf = if avail_len < Self::ENCODED_LEN {
32495 payload_buf[0..avail_len].copy_from_slice(__input);
32496 Bytes::new(&payload_buf)
32497 } else {
32498 Bytes::new(__input)
32499 };
32500 let mut __struct = Self::default();
32501 __struct.time_usec = buf.get_u64_le();
32502 __struct.wind_x = buf.get_f32_le();
32503 __struct.wind_y = buf.get_f32_le();
32504 __struct.wind_z = buf.get_f32_le();
32505 __struct.var_horiz = buf.get_f32_le();
32506 __struct.var_vert = buf.get_f32_le();
32507 __struct.wind_alt = buf.get_f32_le();
32508 __struct.horiz_accuracy = buf.get_f32_le();
32509 __struct.vert_accuracy = buf.get_f32_le();
32510 Ok(__struct)
32511 }
32512 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32513 let mut __tmp = BytesMut::new(bytes);
32514 #[allow(clippy::absurd_extreme_comparisons)]
32515 #[allow(unused_comparisons)]
32516 if __tmp.remaining() < Self::ENCODED_LEN {
32517 panic!(
32518 "buffer is too small (need {} bytes, but got {})",
32519 Self::ENCODED_LEN,
32520 __tmp.remaining(),
32521 )
32522 }
32523 __tmp.put_u64_le(self.time_usec);
32524 __tmp.put_f32_le(self.wind_x);
32525 __tmp.put_f32_le(self.wind_y);
32526 __tmp.put_f32_le(self.wind_z);
32527 __tmp.put_f32_le(self.var_horiz);
32528 __tmp.put_f32_le(self.var_vert);
32529 __tmp.put_f32_le(self.wind_alt);
32530 __tmp.put_f32_le(self.horiz_accuracy);
32531 __tmp.put_f32_le(self.vert_accuracy);
32532 if matches!(version, MavlinkVersion::V2) {
32533 let len = __tmp.len();
32534 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32535 } else {
32536 __tmp.len()
32537 }
32538 }
32539}
32540#[derive(Clone, PartialEq, Debug)]
32541#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32542#[cfg_attr(feature = "serde", serde(tag = "type"))]
32543#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32544#[cfg_attr(feature = "ts", derive(TS))]
32545#[cfg_attr(feature = "ts", ts(export))]
32546#[repr(u32)]
32547pub enum MavMessage {
32548 #[doc = "Set the vehicle attitude and body angular rates."]
32549 #[doc = ""]
32550 #[doc = "ID: 140"]
32551 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32552 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32553 #[doc = ""]
32554 #[doc = "ID: 375"]
32555 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32556 #[doc = "The location and information of an ADSB vehicle."]
32557 #[doc = ""]
32558 #[doc = "ID: 246"]
32559 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32560 #[doc = "The location and information of an AIS vessel."]
32561 #[doc = ""]
32562 #[doc = "ID: 301"]
32563 AIS_VESSEL(AIS_VESSEL_DATA),
32564 #[doc = "The current system altitude."]
32565 #[doc = ""]
32566 #[doc = "ID: 141"]
32567 ALTITUDE(ALTITUDE_DATA),
32568 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32569 #[doc = ""]
32570 #[doc = "ID: 30"]
32571 ATTITUDE(ATTITUDE_DATA),
32572 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32573 #[doc = ""]
32574 #[doc = "ID: 31"]
32575 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32576 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32577 #[doc = ""]
32578 #[doc = "ID: 61"]
32579 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32580 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32581 #[doc = ""]
32582 #[doc = "ID: 83"]
32583 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32584 #[doc = "Motion capture attitude and position."]
32585 #[doc = ""]
32586 #[doc = "ID: 138"]
32587 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32588 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32589 #[doc = ""]
32590 #[doc = "ID: 7"]
32591 AUTH_KEY(AUTH_KEY_DATA),
32592 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32593 #[doc = ""]
32594 #[doc = "ID: 286"]
32595 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32596 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32597 #[doc = ""]
32598 #[doc = "ID: 148"]
32599 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32600 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32601 #[doc = ""]
32602 #[doc = "ID: 435"]
32603 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32604 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32605 #[doc = ""]
32606 #[doc = "ID: 437"]
32607 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32608 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
32609 #[doc = ""]
32610 #[doc = "ID: 372"]
32611 BATTERY_INFO(BATTERY_INFO_DATA),
32612 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
32613 #[doc = ""]
32614 #[doc = "ID: 147"]
32615 BATTERY_STATUS(BATTERY_STATUS_DATA),
32616 #[doc = "Report button state change."]
32617 #[doc = ""]
32618 #[doc = "ID: 257"]
32619 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32620 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32621 #[doc = ""]
32622 #[doc = "ID: 262"]
32623 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32624 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32625 #[doc = ""]
32626 #[doc = "ID: 271"]
32627 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32628 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
32629 #[doc = ""]
32630 #[doc = "ID: 263"]
32631 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32632 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32633 #[doc = ""]
32634 #[doc = "ID: 259"]
32635 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32636 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32637 #[doc = ""]
32638 #[doc = "ID: 260"]
32639 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32640 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
32641 #[doc = ""]
32642 #[doc = "ID: 277"]
32643 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32644 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32645 #[doc = ""]
32646 #[doc = "ID: 276"]
32647 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32648 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32649 #[doc = ""]
32650 #[doc = "ID: 275"]
32651 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32652 #[doc = "Camera-IMU triggering and synchronisation message."]
32653 #[doc = ""]
32654 #[doc = "ID: 112"]
32655 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32656 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
32657 #[doc = ""]
32658 #[doc = "ID: 387"]
32659 CANFD_FRAME(CANFD_FRAME_DATA),
32660 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
32661 #[doc = ""]
32662 #[doc = "ID: 388"]
32663 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32664 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
32665 #[doc = ""]
32666 #[doc = "ID: 386"]
32667 CAN_FRAME(CAN_FRAME_DATA),
32668 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32669 #[doc = ""]
32670 #[doc = "ID: 336"]
32671 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32672 #[doc = "Report current used cellular network status."]
32673 #[doc = ""]
32674 #[doc = "ID: 334"]
32675 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32676 #[doc = "Request to control this MAV."]
32677 #[doc = ""]
32678 #[doc = "ID: 5"]
32679 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32680 #[doc = "Accept / deny control of this MAV."]
32681 #[doc = ""]
32682 #[doc = "ID: 6"]
32683 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32684 #[doc = "Information about a potential collision."]
32685 #[doc = ""]
32686 #[doc = "ID: 247"]
32687 COLLISION(COLLISION_DATA),
32688 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32689 #[doc = ""]
32690 #[doc = "ID: 77"]
32691 COMMAND_ACK(COMMAND_ACK_DATA),
32692 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32693 #[doc = ""]
32694 #[doc = "ID: 80"]
32695 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32696 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32697 #[doc = ""]
32698 #[doc = "ID: 75"]
32699 COMMAND_INT(COMMAND_INT_DATA),
32700 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32701 #[doc = ""]
32702 #[doc = "ID: 76"]
32703 COMMAND_LONG(COMMAND_LONG_DATA),
32704 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
32705 #[doc = ""]
32706 #[doc = "ID: 395"]
32707 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32708 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32709 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
32710 #[doc = ""]
32711 #[doc = "ID: 396"]
32712 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32713 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
32714 #[doc = ""]
32715 #[doc = "ID: 397"]
32716 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32717 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
32718 #[doc = ""]
32719 #[doc = "ID: 146"]
32720 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32721 #[doc = "offset response to encapsulated data."]
32722 #[doc = ""]
32723 #[doc = "ID: 50005"]
32724 CUBEPILOT_FIRMWARE_UPDATE_RESP(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA),
32725 #[doc = "Start firmware update with encapsulated data."]
32726 #[doc = ""]
32727 #[doc = "ID: 50004"]
32728 CUBEPILOT_FIRMWARE_UPDATE_START(CUBEPILOT_FIRMWARE_UPDATE_START_DATA),
32729 #[doc = "Raw RC Data."]
32730 #[doc = ""]
32731 #[doc = "ID: 50001"]
32732 CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA),
32733 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
32734 #[doc = ""]
32735 #[doc = "ID: 411"]
32736 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
32737 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
32738 #[doc = ""]
32739 #[doc = "ID: 436"]
32740 CURRENT_MODE(CURRENT_MODE_DATA),
32741 #[doc = "Data stream status information."]
32742 #[doc = ""]
32743 #[doc = "ID: 67"]
32744 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
32745 DATA_STREAM(DATA_STREAM_DATA),
32746 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32747 #[doc = ""]
32748 #[doc = "ID: 130"]
32749 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
32750 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
32751 #[doc = ""]
32752 #[doc = "ID: 254"]
32753 DEBUG(DEBUG_DATA),
32754 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
32755 #[doc = ""]
32756 #[doc = "ID: 350"]
32757 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
32758 #[doc = "To debug something using a named 3D vector."]
32759 #[doc = ""]
32760 #[doc = "ID: 250"]
32761 DEBUG_VECT(DEBUG_VECT_DATA),
32762 #[doc = "Distance sensor information for an onboard rangefinder."]
32763 #[doc = ""]
32764 #[doc = "ID: 132"]
32765 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
32766 #[doc = "EFI status output."]
32767 #[doc = ""]
32768 #[doc = "ID: 225"]
32769 EFI_STATUS(EFI_STATUS_DATA),
32770 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32771 #[doc = ""]
32772 #[doc = "ID: 131"]
32773 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
32774 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
32775 #[doc = ""]
32776 #[doc = "ID: 290"]
32777 ESC_INFO(ESC_INFO_DATA),
32778 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
32779 #[doc = ""]
32780 #[doc = "ID: 291"]
32781 ESC_STATUS(ESC_STATUS_DATA),
32782 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
32783 #[doc = ""]
32784 #[doc = "ID: 230"]
32785 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
32786 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
32787 #[doc = ""]
32788 #[doc = "ID: 410"]
32789 EVENT(EVENT_DATA),
32790 #[doc = "Provides state for additional features."]
32791 #[doc = ""]
32792 #[doc = "ID: 245"]
32793 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
32794 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
32795 #[doc = ""]
32796 #[doc = "ID: 162"]
32797 FENCE_STATUS(FENCE_STATUS_DATA),
32798 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
32799 #[doc = ""]
32800 #[doc = "ID: 110"]
32801 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
32802 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
32803 #[doc = ""]
32804 #[doc = "ID: 264"]
32805 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
32806 #[doc = "Current motion information from a designated system."]
32807 #[doc = ""]
32808 #[doc = "ID: 144"]
32809 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
32810 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
32811 #[doc = ""]
32812 #[doc = "ID: 371"]
32813 FUEL_STATUS(FUEL_STATUS_DATA),
32814 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
32815 #[doc = ""]
32816 #[doc = "ID: 373"]
32817 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
32818 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
32819 #[doc = ""]
32820 #[doc = "ID: 285"]
32821 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
32822 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
32823 #[doc = ""]
32824 #[doc = "ID: 283"]
32825 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
32826 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
32827 #[doc = ""]
32828 #[doc = "ID: 284"]
32829 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
32830 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
32831 #[doc = ""]
32832 #[doc = "ID: 280"]
32833 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
32834 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32835 #[doc = ""]
32836 #[doc = "ID: 282"]
32837 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
32838 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32839 #[doc = ""]
32840 #[doc = "ID: 288"]
32841 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
32842 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
32843 #[doc = ""]
32844 #[doc = "ID: 287"]
32845 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32846 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
32847 #[doc = ""]
32848 #[doc = "ID: 281"]
32849 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32850 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
32851 #[doc = ""]
32852 #[doc = "ID: 33"]
32853 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32854 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
32855 #[doc = ""]
32856 #[doc = "ID: 63"]
32857 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32858 #[doc = "Global position/attitude estimate from a vision source."]
32859 #[doc = ""]
32860 #[doc = "ID: 101"]
32861 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32862 #[doc = "Second GPS data."]
32863 #[doc = ""]
32864 #[doc = "ID: 124"]
32865 GPS2_RAW(GPS2_RAW_DATA),
32866 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32867 #[doc = ""]
32868 #[doc = "ID: 128"]
32869 GPS2_RTK(GPS2_RTK_DATA),
32870 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
32871 #[doc = ""]
32872 #[doc = "ID: 49"]
32873 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32874 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
32875 #[doc = ""]
32876 #[doc = "ID: 123"]
32877 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32878 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32879 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
32880 #[doc = ""]
32881 #[doc = "ID: 232"]
32882 GPS_INPUT(GPS_INPUT_DATA),
32883 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32884 #[doc = ""]
32885 #[doc = "ID: 24"]
32886 GPS_RAW_INT(GPS_RAW_INT_DATA),
32887 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
32888 #[doc = ""]
32889 #[doc = "ID: 233"]
32890 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32891 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32892 #[doc = ""]
32893 #[doc = "ID: 127"]
32894 GPS_RTK(GPS_RTK_DATA),
32895 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
32896 #[doc = ""]
32897 #[doc = "ID: 25"]
32898 GPS_STATUS(GPS_STATUS_DATA),
32899 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
32900 #[doc = ""]
32901 #[doc = "ID: 0"]
32902 HEARTBEAT(HEARTBEAT_DATA),
32903 #[doc = "Herelink Telemetry."]
32904 #[doc = ""]
32905 #[doc = "ID: 50003"]
32906 HERELINK_TELEM(HERELINK_TELEM_DATA),
32907 #[doc = "Information about video stream."]
32908 #[doc = ""]
32909 #[doc = "ID: 50002"]
32910 HERELINK_VIDEO_STREAM_INFORMATION(HERELINK_VIDEO_STREAM_INFORMATION_DATA),
32911 #[doc = "The IMU readings in SI units in NED body frame."]
32912 #[doc = ""]
32913 #[doc = "ID: 105"]
32914 HIGHRES_IMU(HIGHRES_IMU_DATA),
32915 #[doc = "Message appropriate for high latency connections like Iridium."]
32916 #[doc = ""]
32917 #[doc = "ID: 234"]
32918 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32919 HIGH_LATENCY(HIGH_LATENCY_DATA),
32920 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
32921 #[doc = ""]
32922 #[doc = "ID: 235"]
32923 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32924 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
32925 #[doc = ""]
32926 #[doc = "ID: 93"]
32927 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32928 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
32929 #[doc = ""]
32930 #[doc = "ID: 91"]
32931 HIL_CONTROLS(HIL_CONTROLS_DATA),
32932 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32933 #[doc = ""]
32934 #[doc = "ID: 113"]
32935 HIL_GPS(HIL_GPS_DATA),
32936 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
32937 #[doc = ""]
32938 #[doc = "ID: 114"]
32939 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32940 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
32941 #[doc = ""]
32942 #[doc = "ID: 92"]
32943 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32944 #[doc = "The IMU readings in SI units in NED body frame."]
32945 #[doc = ""]
32946 #[doc = "ID: 107"]
32947 HIL_SENSOR(HIL_SENSOR_DATA),
32948 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32949 #[doc = ""]
32950 #[doc = "ID: 90"]
32951 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32952 HIL_STATE(HIL_STATE_DATA),
32953 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32954 #[doc = ""]
32955 #[doc = "ID: 115"]
32956 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32957 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
32958 #[doc = ""]
32959 #[doc = "ID: 242"]
32960 HOME_POSITION(HOME_POSITION_DATA),
32961 #[doc = "Temperature and humidity from hygrometer."]
32962 #[doc = ""]
32963 #[doc = "ID: 12920"]
32964 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32965 #[doc = "Illuminator status."]
32966 #[doc = ""]
32967 #[doc = "ID: 440"]
32968 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32969 #[doc = "Status of the Iridium SBD link."]
32970 #[doc = ""]
32971 #[doc = "ID: 335"]
32972 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32973 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32974 #[doc = ""]
32975 #[doc = "ID: 149"]
32976 LANDING_TARGET(LANDING_TARGET_DATA),
32977 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32978 #[doc = ""]
32979 #[doc = "ID: 8"]
32980 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32981 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32982 #[doc = ""]
32983 #[doc = "ID: 32"]
32984 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32985 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32986 #[doc = ""]
32987 #[doc = "ID: 64"]
32988 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32989 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32990 #[doc = ""]
32991 #[doc = "ID: 89"]
32992 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32993 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32994 #[doc = ""]
32995 #[doc = "ID: 268"]
32996 LOGGING_ACK(LOGGING_ACK_DATA),
32997 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32998 #[doc = ""]
32999 #[doc = "ID: 266"]
33000 LOGGING_DATA(LOGGING_DATA_DATA),
33001 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
33002 #[doc = ""]
33003 #[doc = "ID: 267"]
33004 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33005 #[doc = "Reply to LOG_REQUEST_DATA."]
33006 #[doc = ""]
33007 #[doc = "ID: 120"]
33008 LOG_DATA(LOG_DATA_DATA),
33009 #[doc = "Reply to LOG_REQUEST_LIST."]
33010 #[doc = ""]
33011 #[doc = "ID: 118"]
33012 LOG_ENTRY(LOG_ENTRY_DATA),
33013 #[doc = "Erase all logs."]
33014 #[doc = ""]
33015 #[doc = "ID: 121"]
33016 LOG_ERASE(LOG_ERASE_DATA),
33017 #[doc = "Request a chunk of a log."]
33018 #[doc = ""]
33019 #[doc = "ID: 119"]
33020 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33021 #[doc = "Stop log transfer and resume normal logging."]
33022 #[doc = ""]
33023 #[doc = "ID: 122"]
33024 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33025 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
33026 #[doc = ""]
33027 #[doc = "ID: 117"]
33028 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33029 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
33030 #[doc = ""]
33031 #[doc = "ID: 192"]
33032 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33033 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
33034 #[doc = ""]
33035 #[doc = "ID: 69"]
33036 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33037 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
33038 #[doc = ""]
33039 #[doc = "ID: 81"]
33040 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33041 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33042 #[doc = ""]
33043 #[doc = "ID: 249"]
33044 MEMORY_VECT(MEMORY_VECT_DATA),
33045 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
33046 #[doc = ""]
33047 #[doc = "ID: 244"]
33048 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33049 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
33050 #[doc = ""]
33051 #[doc = "ID: 47"]
33052 MISSION_ACK(MISSION_ACK_DATA),
33053 #[doc = "Delete all mission items at once."]
33054 #[doc = ""]
33055 #[doc = "ID: 45"]
33056 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33057 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
33058 #[doc = ""]
33059 #[doc = "ID: 44"]
33060 MISSION_COUNT(MISSION_COUNT_DATA),
33061 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
33062 #[doc = ""]
33063 #[doc = "ID: 42"]
33064 MISSION_CURRENT(MISSION_CURRENT_DATA),
33065 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33066 #[doc = ""]
33067 #[doc = "ID: 39"]
33068 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
33069 MISSION_ITEM(MISSION_ITEM_DATA),
33070 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33071 #[doc = ""]
33072 #[doc = "ID: 73"]
33073 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33074 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
33075 #[doc = ""]
33076 #[doc = "ID: 46"]
33077 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33078 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
33079 #[doc = ""]
33080 #[doc = "ID: 40"]
33081 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
33082 MISSION_REQUEST(MISSION_REQUEST_DATA),
33083 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
33084 #[doc = ""]
33085 #[doc = "ID: 51"]
33086 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33087 #[doc = "Request the overall list of mission items from the system/component."]
33088 #[doc = ""]
33089 #[doc = "ID: 43"]
33090 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33091 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
33092 #[doc = ""]
33093 #[doc = "ID: 37"]
33094 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33095 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33096 #[doc = ""]
33097 #[doc = "ID: 41"]
33098 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33099 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33100 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33101 #[doc = ""]
33102 #[doc = "ID: 38"]
33103 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33104 #[doc = "Orientation of a mount."]
33105 #[doc = ""]
33106 #[doc = "ID: 265"]
33107 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33108 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33109 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33110 #[doc = ""]
33111 #[doc = "ID: 251"]
33112 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33113 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33114 #[doc = ""]
33115 #[doc = "ID: 252"]
33116 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33117 #[doc = "The state of the navigation and position controller."]
33118 #[doc = ""]
33119 #[doc = "ID: 62"]
33120 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33121 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33122 #[doc = ""]
33123 #[doc = "ID: 330"]
33124 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33125 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33126 #[doc = ""]
33127 #[doc = "ID: 331"]
33128 ODOMETRY(ODOMETRY_DATA),
33129 #[doc = "Hardware status sent by an onboard computer."]
33130 #[doc = ""]
33131 #[doc = "ID: 390"]
33132 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33133 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33134 #[doc = ""]
33135 #[doc = "ID: 12918"]
33136 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33137 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33138 #[doc = ""]
33139 #[doc = "ID: 12902"]
33140 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33141 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33142 #[doc = ""]
33143 #[doc = "ID: 12900"]
33144 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33145 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33146 #[doc = ""]
33147 #[doc = "ID: 12901"]
33148 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33149 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33150 #[doc = ""]
33151 #[doc = "ID: 12915"]
33152 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33153 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33154 #[doc = ""]
33155 #[doc = "ID: 12905"]
33156 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33157 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33158 #[doc = ""]
33159 #[doc = "ID: 12903"]
33160 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33161 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33162 #[doc = ""]
33163 #[doc = "ID: 12904"]
33164 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33165 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33166 #[doc = ""]
33167 #[doc = "ID: 12919"]
33168 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33169 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33170 #[doc = ""]
33171 #[doc = "ID: 100"]
33172 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33173 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33174 #[doc = ""]
33175 #[doc = "ID: 106"]
33176 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33177 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33178 #[doc = ""]
33179 #[doc = "ID: 360"]
33180 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33181 #[doc = "Response from a PARAM_EXT_SET message."]
33182 #[doc = ""]
33183 #[doc = "ID: 324"]
33184 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33185 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33186 #[doc = ""]
33187 #[doc = "ID: 321"]
33188 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33189 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33190 #[doc = ""]
33191 #[doc = "ID: 320"]
33192 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33193 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33194 #[doc = ""]
33195 #[doc = "ID: 323"]
33196 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33197 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33198 #[doc = ""]
33199 #[doc = "ID: 322"]
33200 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33201 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33202 #[doc = ""]
33203 #[doc = "ID: 50"]
33204 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33205 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33206 #[doc = ""]
33207 #[doc = "ID: 21"]
33208 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33209 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33210 #[doc = ""]
33211 #[doc = "ID: 20"]
33212 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33213 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33214 #[doc = ""]
33215 #[doc = "ID: 23"]
33216 PARAM_SET(PARAM_SET_DATA),
33217 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33218 #[doc = ""]
33219 #[doc = "ID: 22"]
33220 PARAM_VALUE(PARAM_VALUE_DATA),
33221 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33222 #[doc = ""]
33223 #[doc = "ID: 4"]
33224 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33225 PING(PING_DATA),
33226 #[doc = "Control vehicle tone generation (buzzer)."]
33227 #[doc = ""]
33228 #[doc = "ID: 258"]
33229 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33230 PLAY_TUNE(PLAY_TUNE_DATA),
33231 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33232 #[doc = ""]
33233 #[doc = "ID: 400"]
33234 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33235 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33236 #[doc = ""]
33237 #[doc = "ID: 87"]
33238 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33239 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33240 #[doc = ""]
33241 #[doc = "ID: 85"]
33242 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33243 #[doc = "Power supply status."]
33244 #[doc = ""]
33245 #[doc = "ID: 125"]
33246 POWER_STATUS(POWER_STATUS_DATA),
33247 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33248 #[doc = ""]
33249 #[doc = "ID: 300"]
33250 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33251 #[doc = "Status generated by radio and injected into MAVLink stream."]
33252 #[doc = ""]
33253 #[doc = "ID: 109"]
33254 RADIO_STATUS(RADIO_STATUS_DATA),
33255 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33256 #[doc = ""]
33257 #[doc = "ID: 27"]
33258 RAW_IMU(RAW_IMU_DATA),
33259 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33260 #[doc = ""]
33261 #[doc = "ID: 28"]
33262 RAW_PRESSURE(RAW_PRESSURE_DATA),
33263 #[doc = "RPM sensor data message."]
33264 #[doc = ""]
33265 #[doc = "ID: 339"]
33266 RAW_RPM(RAW_RPM_DATA),
33267 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33268 #[doc = ""]
33269 #[doc = "ID: 65"]
33270 RC_CHANNELS(RC_CHANNELS_DATA),
33271 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33272 #[doc = ""]
33273 #[doc = "ID: 70"]
33274 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33275 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33276 #[doc = ""]
33277 #[doc = "ID: 35"]
33278 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33279 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33280 #[doc = ""]
33281 #[doc = "ID: 34"]
33282 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33283 #[doc = "Request a data stream."]
33284 #[doc = ""]
33285 #[doc = "ID: 66"]
33286 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33287 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33288 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33289 #[doc = ""]
33290 #[doc = "ID: 412"]
33291 REQUEST_EVENT(REQUEST_EVENT_DATA),
33292 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33293 #[doc = ""]
33294 #[doc = "ID: 142"]
33295 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33296 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33297 #[doc = ""]
33298 #[doc = "ID: 413"]
33299 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33300 #[doc = "Read out the safety zone the MAV currently assumes."]
33301 #[doc = ""]
33302 #[doc = "ID: 55"]
33303 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33304 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33305 #[doc = ""]
33306 #[doc = "ID: 54"]
33307 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33308 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33309 #[doc = ""]
33310 #[doc = "ID: 26"]
33311 SCALED_IMU(SCALED_IMU_DATA),
33312 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33313 #[doc = ""]
33314 #[doc = "ID: 116"]
33315 SCALED_IMU2(SCALED_IMU2_DATA),
33316 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33317 #[doc = ""]
33318 #[doc = "ID: 129"]
33319 SCALED_IMU3(SCALED_IMU3_DATA),
33320 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33321 #[doc = ""]
33322 #[doc = "ID: 29"]
33323 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33324 #[doc = "Barometer readings for 2nd barometer."]
33325 #[doc = ""]
33326 #[doc = "ID: 137"]
33327 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33328 #[doc = "Barometer readings for 3rd barometer."]
33329 #[doc = ""]
33330 #[doc = "ID: 143"]
33331 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33332 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33333 #[doc = ""]
33334 #[doc = "ID: 126"]
33335 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33336 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33337 #[doc = ""]
33338 #[doc = "ID: 36"]
33339 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33340 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33341 #[doc = ""]
33342 #[doc = "ID: 256"]
33343 SETUP_SIGNING(SETUP_SIGNING_DATA),
33344 #[doc = "Set the vehicle attitude and body angular rates."]
33345 #[doc = ""]
33346 #[doc = "ID: 139"]
33347 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33348 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33349 #[doc = ""]
33350 #[doc = "ID: 82"]
33351 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33352 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33353 #[doc = ""]
33354 #[doc = "ID: 48"]
33355 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33356 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33357 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33358 #[doc = ""]
33359 #[doc = "ID: 243"]
33360 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33361 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33362 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33363 #[doc = ""]
33364 #[doc = "ID: 11"]
33365 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33366 SET_MODE(SET_MODE_DATA),
33367 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33368 #[doc = ""]
33369 #[doc = "ID: 86"]
33370 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33371 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33372 #[doc = ""]
33373 #[doc = "ID: 84"]
33374 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33375 #[doc = "Status of simulation environment, if used."]
33376 #[doc = ""]
33377 #[doc = "ID: 108"]
33378 SIM_STATE(SIM_STATE_DATA),
33379 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33380 #[doc = ""]
33381 #[doc = "ID: 370"]
33382 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33383 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33384 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33385 #[doc = ""]
33386 #[doc = "ID: 253"]
33387 STATUSTEXT(STATUSTEXT_DATA),
33388 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
33389 #[doc = ""]
33390 #[doc = "ID: 261"]
33391 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33392 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
33393 #[doc = ""]
33394 #[doc = "ID: 401"]
33395 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33396 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
33397 #[doc = ""]
33398 #[doc = "ID: 2"]
33399 SYSTEM_TIME(SYSTEM_TIME_DATA),
33400 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
33401 #[doc = ""]
33402 #[doc = "ID: 1"]
33403 SYS_STATUS(SYS_STATUS_DATA),
33404 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
33405 #[doc = ""]
33406 #[doc = "ID: 135"]
33407 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33408 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33409 #[doc = ""]
33410 #[doc = "ID: 134"]
33411 TERRAIN_DATA(TERRAIN_DATA_DATA),
33412 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33413 #[doc = ""]
33414 #[doc = "ID: 136"]
33415 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33416 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33417 #[doc = ""]
33418 #[doc = "ID: 133"]
33419 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33420 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
33421 #[doc = ""]
33422 #[doc = "ID: 111"]
33423 TIMESYNC(TIMESYNC_DATA),
33424 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33425 #[doc = ""]
33426 #[doc = "ID: 380"]
33427 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33428 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33429 #[doc = ""]
33430 #[doc = "ID: 333"]
33431 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33432 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33433 #[doc = ""]
33434 #[doc = "ID: 332"]
33435 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33436 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33437 #[doc = ""]
33438 #[doc = "ID: 385"]
33439 TUNNEL(TUNNEL_DATA),
33440 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33441 #[doc = ""]
33442 #[doc = "ID: 311"]
33443 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33444 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33445 #[doc = ""]
33446 #[doc = "ID: 310"]
33447 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33448 #[doc = "The global position resulting from GPS and sensor fusion."]
33449 #[doc = ""]
33450 #[doc = "ID: 340"]
33451 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33452 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33453 #[doc = ""]
33454 #[doc = "ID: 248"]
33455 V2_EXTENSION(V2_EXTENSION_DATA),
33456 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33457 #[doc = ""]
33458 #[doc = "ID: 74"]
33459 VFR_HUD(VFR_HUD_DATA),
33460 #[doc = "Vibration levels and accelerometer clipping."]
33461 #[doc = ""]
33462 #[doc = "ID: 241"]
33463 VIBRATION(VIBRATION_DATA),
33464 #[doc = "Global position estimate from a Vicon motion system source."]
33465 #[doc = ""]
33466 #[doc = "ID: 104"]
33467 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33468 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33469 #[doc = ""]
33470 #[doc = "ID: 269"]
33471 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33472 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33473 #[doc = ""]
33474 #[doc = "ID: 270"]
33475 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33476 #[doc = "Local position/attitude estimate from a vision source."]
33477 #[doc = ""]
33478 #[doc = "ID: 102"]
33479 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33480 #[doc = "Speed estimate from a vision source."]
33481 #[doc = ""]
33482 #[doc = "ID: 103"]
33483 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33484 #[doc = "Cumulative distance traveled for each reported wheel."]
33485 #[doc = ""]
33486 #[doc = "ID: 9000"]
33487 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33488 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33489 #[doc = ""]
33490 #[doc = "ID: 299"]
33491 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33492 #[doc = "Winch status."]
33493 #[doc = ""]
33494 #[doc = "ID: 9005"]
33495 WINCH_STATUS(WINCH_STATUS_DATA),
33496 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33497 #[doc = ""]
33498 #[doc = "ID: 231"]
33499 WIND_COV(WIND_COV_DATA),
33500}
33501impl MavMessage {
33502 pub const fn all_ids() -> &'static [u32] {
33503 &[
33504 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33505 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33506 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33507 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33508 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33509 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33510 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33511 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33512 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33513 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33514 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
33515 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
33516 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
33517 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
33518 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
33519 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
33520 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
33521 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
33522 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
33523 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
33524 12915u32, 12918u32, 12919u32, 12920u32, 50001u32, 50002u32, 50003u32, 50004u32,
33525 50005u32,
33526 ]
33527 }
33528}
33529impl Message for MavMessage {
33530 fn parse(
33531 version: MavlinkVersion,
33532 id: u32,
33533 payload: &[u8],
33534 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33535 match id {
33536 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33537 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33538 .map(Self::ACTUATOR_CONTROL_TARGET)
33539 }
33540 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33541 .map(Self::ACTUATOR_OUTPUT_STATUS),
33542 ADSB_VEHICLE_DATA::ID => {
33543 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33544 }
33545 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33546 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33547 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33548 ATTITUDE_QUATERNION_DATA::ID => {
33549 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33550 }
33551 ATTITUDE_QUATERNION_COV_DATA::ID => {
33552 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33553 .map(Self::ATTITUDE_QUATERNION_COV)
33554 }
33555 ATTITUDE_TARGET_DATA::ID => {
33556 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33557 }
33558 ATT_POS_MOCAP_DATA::ID => {
33559 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33560 }
33561 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33562 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33563 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33564 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33565 }
33566 AUTOPILOT_VERSION_DATA::ID => {
33567 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33568 }
33569 AVAILABLE_MODES_DATA::ID => {
33570 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33571 }
33572 AVAILABLE_MODES_MONITOR_DATA::ID => {
33573 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33574 .map(Self::AVAILABLE_MODES_MONITOR)
33575 }
33576 BATTERY_INFO_DATA::ID => {
33577 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33578 }
33579 BATTERY_STATUS_DATA::ID => {
33580 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33581 }
33582 BUTTON_CHANGE_DATA::ID => {
33583 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33584 }
33585 CAMERA_CAPTURE_STATUS_DATA::ID => {
33586 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33587 }
33588 CAMERA_FOV_STATUS_DATA::ID => {
33589 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33590 }
33591 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33592 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33593 }
33594 CAMERA_INFORMATION_DATA::ID => {
33595 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33596 }
33597 CAMERA_SETTINGS_DATA::ID => {
33598 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33599 }
33600 CAMERA_THERMAL_RANGE_DATA::ID => {
33601 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33602 }
33603 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33604 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33605 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33606 }
33607 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33608 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33609 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33610 }
33611 CAMERA_TRIGGER_DATA::ID => {
33612 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33613 }
33614 CANFD_FRAME_DATA::ID => {
33615 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33616 }
33617 CAN_FILTER_MODIFY_DATA::ID => {
33618 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33619 }
33620 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33621 CELLULAR_CONFIG_DATA::ID => {
33622 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33623 }
33624 CELLULAR_STATUS_DATA::ID => {
33625 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33626 }
33627 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33628 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33629 .map(Self::CHANGE_OPERATOR_CONTROL)
33630 }
33631 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33632 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33633 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33634 }
33635 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33636 COMMAND_ACK_DATA::ID => {
33637 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33638 }
33639 COMMAND_CANCEL_DATA::ID => {
33640 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33641 }
33642 COMMAND_INT_DATA::ID => {
33643 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33644 }
33645 COMMAND_LONG_DATA::ID => {
33646 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33647 }
33648 COMPONENT_INFORMATION_DATA::ID => {
33649 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33650 }
33651 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33652 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33653 .map(Self::COMPONENT_INFORMATION_BASIC)
33654 }
33655 COMPONENT_METADATA_DATA::ID => {
33656 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33657 }
33658 CONTROL_SYSTEM_STATE_DATA::ID => {
33659 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33660 }
33661 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
33662 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::deser(version, payload)
33663 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP)
33664 }
33665 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
33666 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::deser(version, payload)
33667 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_START)
33668 }
33669 CUBEPILOT_RAW_RC_DATA::ID => {
33670 CUBEPILOT_RAW_RC_DATA::deser(version, payload).map(Self::CUBEPILOT_RAW_RC)
33671 }
33672 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33673 .map(Self::CURRENT_EVENT_SEQUENCE),
33674 CURRENT_MODE_DATA::ID => {
33675 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33676 }
33677 DATA_STREAM_DATA::ID => {
33678 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33679 }
33680 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33681 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33682 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33683 }
33684 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33685 DEBUG_FLOAT_ARRAY_DATA::ID => {
33686 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33687 }
33688 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33689 DISTANCE_SENSOR_DATA::ID => {
33690 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33691 }
33692 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33693 ENCAPSULATED_DATA_DATA::ID => {
33694 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33695 }
33696 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33697 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33698 ESTIMATOR_STATUS_DATA::ID => {
33699 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33700 }
33701 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33702 EXTENDED_SYS_STATE_DATA::ID => {
33703 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33704 }
33705 FENCE_STATUS_DATA::ID => {
33706 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33707 }
33708 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33709 .map(Self::FILE_TRANSFER_PROTOCOL),
33710 FLIGHT_INFORMATION_DATA::ID => {
33711 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33712 }
33713 FOLLOW_TARGET_DATA::ID => {
33714 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33715 }
33716 FUEL_STATUS_DATA::ID => {
33717 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33718 }
33719 GENERATOR_STATUS_DATA::ID => {
33720 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33721 }
33722 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33723 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33724 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33725 }
33726 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33727 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33728 .map(Self::GIMBAL_DEVICE_INFORMATION)
33729 }
33730 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33731 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33732 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33733 }
33734 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33735 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33736 .map(Self::GIMBAL_MANAGER_INFORMATION)
33737 }
33738 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33739 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33740 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33741 }
33742 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33743 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
33744 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
33745 }
33746 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
33747 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
33748 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
33749 }
33750 GIMBAL_MANAGER_STATUS_DATA::ID => {
33751 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
33752 }
33753 GLOBAL_POSITION_INT_DATA::ID => {
33754 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
33755 }
33756 GLOBAL_POSITION_INT_COV_DATA::ID => {
33757 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33758 .map(Self::GLOBAL_POSITION_INT_COV)
33759 }
33760 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33761 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33762 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33763 }
33764 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33765 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33766 GPS_GLOBAL_ORIGIN_DATA::ID => {
33767 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33768 }
33769 GPS_INJECT_DATA_DATA::ID => {
33770 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33771 }
33772 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33773 GPS_RAW_INT_DATA::ID => {
33774 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33775 }
33776 GPS_RTCM_DATA_DATA::ID => {
33777 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33778 }
33779 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33780 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33781 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33782 HERELINK_TELEM_DATA::ID => {
33783 HERELINK_TELEM_DATA::deser(version, payload).map(Self::HERELINK_TELEM)
33784 }
33785 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
33786 HERELINK_VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33787 .map(Self::HERELINK_VIDEO_STREAM_INFORMATION)
33788 }
33789 HIGHRES_IMU_DATA::ID => {
33790 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33791 }
33792 HIGH_LATENCY_DATA::ID => {
33793 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33794 }
33795 HIGH_LATENCY2_DATA::ID => {
33796 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33797 }
33798 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33799 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33800 }
33801 HIL_CONTROLS_DATA::ID => {
33802 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33803 }
33804 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33805 HIL_OPTICAL_FLOW_DATA::ID => {
33806 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33807 }
33808 HIL_RC_INPUTS_RAW_DATA::ID => {
33809 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33810 }
33811 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33812 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33813 HIL_STATE_QUATERNION_DATA::ID => {
33814 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33815 }
33816 HOME_POSITION_DATA::ID => {
33817 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33818 }
33819 HYGROMETER_SENSOR_DATA::ID => {
33820 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33821 }
33822 ILLUMINATOR_STATUS_DATA::ID => {
33823 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33824 }
33825 ISBD_LINK_STATUS_DATA::ID => {
33826 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33827 }
33828 LANDING_TARGET_DATA::ID => {
33829 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33830 }
33831 LINK_NODE_STATUS_DATA::ID => {
33832 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33833 }
33834 LOCAL_POSITION_NED_DATA::ID => {
33835 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33836 }
33837 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33838 .map(Self::LOCAL_POSITION_NED_COV),
33839 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33840 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33841 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33842 }
33843 LOGGING_ACK_DATA::ID => {
33844 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33845 }
33846 LOGGING_DATA_DATA::ID => {
33847 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33848 }
33849 LOGGING_DATA_ACKED_DATA::ID => {
33850 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33851 }
33852 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33853 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33854 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33855 LOG_REQUEST_DATA_DATA::ID => {
33856 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33857 }
33858 LOG_REQUEST_END_DATA::ID => {
33859 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33860 }
33861 LOG_REQUEST_LIST_DATA::ID => {
33862 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33863 }
33864 MAG_CAL_REPORT_DATA::ID => {
33865 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33866 }
33867 MANUAL_CONTROL_DATA::ID => {
33868 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33869 }
33870 MANUAL_SETPOINT_DATA::ID => {
33871 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33872 }
33873 MEMORY_VECT_DATA::ID => {
33874 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33875 }
33876 MESSAGE_INTERVAL_DATA::ID => {
33877 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33878 }
33879 MISSION_ACK_DATA::ID => {
33880 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33881 }
33882 MISSION_CLEAR_ALL_DATA::ID => {
33883 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33884 }
33885 MISSION_COUNT_DATA::ID => {
33886 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33887 }
33888 MISSION_CURRENT_DATA::ID => {
33889 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33890 }
33891 MISSION_ITEM_DATA::ID => {
33892 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33893 }
33894 MISSION_ITEM_INT_DATA::ID => {
33895 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33896 }
33897 MISSION_ITEM_REACHED_DATA::ID => {
33898 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33899 }
33900 MISSION_REQUEST_DATA::ID => {
33901 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33902 }
33903 MISSION_REQUEST_INT_DATA::ID => {
33904 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33905 }
33906 MISSION_REQUEST_LIST_DATA::ID => {
33907 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33908 }
33909 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33910 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33911 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33912 }
33913 MISSION_SET_CURRENT_DATA::ID => {
33914 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33915 }
33916 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33917 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33918 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33919 }
33920 MOUNT_ORIENTATION_DATA::ID => {
33921 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33922 }
33923 NAMED_VALUE_FLOAT_DATA::ID => {
33924 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33925 }
33926 NAMED_VALUE_INT_DATA::ID => {
33927 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33928 }
33929 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33930 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33931 }
33932 OBSTACLE_DISTANCE_DATA::ID => {
33933 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33934 }
33935 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33936 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33937 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33938 .map(Self::ONBOARD_COMPUTER_STATUS)
33939 }
33940 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33941 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33942 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33943 }
33944 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33945 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33946 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33947 }
33948 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33949 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33950 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33951 .map(Self::OPEN_DRONE_ID_LOCATION),
33952 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33953 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33954 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33955 }
33956 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33957 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33958 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33959 }
33960 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33961 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33962 }
33963 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33964 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33965 }
33966 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33967 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33968 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33969 }
33970 OPTICAL_FLOW_DATA::ID => {
33971 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33972 }
33973 OPTICAL_FLOW_RAD_DATA::ID => {
33974 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33975 }
33976 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33977 .map(Self::ORBIT_EXECUTION_STATUS),
33978 PARAM_EXT_ACK_DATA::ID => {
33979 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33980 }
33981 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33982 .map(Self::PARAM_EXT_REQUEST_LIST),
33983 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33984 .map(Self::PARAM_EXT_REQUEST_READ),
33985 PARAM_EXT_SET_DATA::ID => {
33986 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33987 }
33988 PARAM_EXT_VALUE_DATA::ID => {
33989 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33990 }
33991 PARAM_MAP_RC_DATA::ID => {
33992 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33993 }
33994 PARAM_REQUEST_LIST_DATA::ID => {
33995 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33996 }
33997 PARAM_REQUEST_READ_DATA::ID => {
33998 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33999 }
34000 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
34001 PARAM_VALUE_DATA::ID => {
34002 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
34003 }
34004 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
34005 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
34006 PLAY_TUNE_V2_DATA::ID => {
34007 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
34008 }
34009 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34010 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34011 .map(Self::POSITION_TARGET_GLOBAL_INT)
34012 }
34013 POSITION_TARGET_LOCAL_NED_DATA::ID => {
34014 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34015 .map(Self::POSITION_TARGET_LOCAL_NED)
34016 }
34017 POWER_STATUS_DATA::ID => {
34018 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
34019 }
34020 PROTOCOL_VERSION_DATA::ID => {
34021 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
34022 }
34023 RADIO_STATUS_DATA::ID => {
34024 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
34025 }
34026 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
34027 RAW_PRESSURE_DATA::ID => {
34028 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
34029 }
34030 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
34031 RC_CHANNELS_DATA::ID => {
34032 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
34033 }
34034 RC_CHANNELS_OVERRIDE_DATA::ID => {
34035 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
34036 }
34037 RC_CHANNELS_RAW_DATA::ID => {
34038 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
34039 }
34040 RC_CHANNELS_SCALED_DATA::ID => {
34041 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
34042 }
34043 REQUEST_DATA_STREAM_DATA::ID => {
34044 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
34045 }
34046 REQUEST_EVENT_DATA::ID => {
34047 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
34048 }
34049 RESOURCE_REQUEST_DATA::ID => {
34050 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
34051 }
34052 RESPONSE_EVENT_ERROR_DATA::ID => {
34053 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
34054 }
34055 SAFETY_ALLOWED_AREA_DATA::ID => {
34056 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
34057 }
34058 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
34059 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
34060 .map(Self::SAFETY_SET_ALLOWED_AREA)
34061 }
34062 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
34063 SCALED_IMU2_DATA::ID => {
34064 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
34065 }
34066 SCALED_IMU3_DATA::ID => {
34067 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
34068 }
34069 SCALED_PRESSURE_DATA::ID => {
34070 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
34071 }
34072 SCALED_PRESSURE2_DATA::ID => {
34073 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
34074 }
34075 SCALED_PRESSURE3_DATA::ID => {
34076 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
34077 }
34078 SERIAL_CONTROL_DATA::ID => {
34079 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
34080 }
34081 SERVO_OUTPUT_RAW_DATA::ID => {
34082 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
34083 }
34084 SETUP_SIGNING_DATA::ID => {
34085 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
34086 }
34087 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
34088 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
34089 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
34090 }
34091 SET_ATTITUDE_TARGET_DATA::ID => {
34092 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
34093 }
34094 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
34095 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
34096 }
34097 SET_HOME_POSITION_DATA::ID => {
34098 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
34099 }
34100 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
34101 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34102 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34103 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
34104 }
34105 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
34106 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34107 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
34108 }
34109 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
34110 SMART_BATTERY_INFO_DATA::ID => {
34111 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
34112 }
34113 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
34114 STORAGE_INFORMATION_DATA::ID => {
34115 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
34116 }
34117 SUPPORTED_TUNES_DATA::ID => {
34118 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
34119 }
34120 SYSTEM_TIME_DATA::ID => {
34121 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
34122 }
34123 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
34124 TERRAIN_CHECK_DATA::ID => {
34125 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
34126 }
34127 TERRAIN_DATA_DATA::ID => {
34128 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
34129 }
34130 TERRAIN_REPORT_DATA::ID => {
34131 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
34132 }
34133 TERRAIN_REQUEST_DATA::ID => {
34134 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
34135 }
34136 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
34137 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
34138 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
34139 .map(Self::TIME_ESTIMATE_TO_TARGET)
34140 }
34141 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34142 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
34143 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
34144 }
34145 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34146 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
34147 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
34148 }
34149 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
34150 UAVCAN_NODE_INFO_DATA::ID => {
34151 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
34152 }
34153 UAVCAN_NODE_STATUS_DATA::ID => {
34154 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
34155 }
34156 UTM_GLOBAL_POSITION_DATA::ID => {
34157 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
34158 }
34159 V2_EXTENSION_DATA::ID => {
34160 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
34161 }
34162 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
34163 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
34164 VICON_POSITION_ESTIMATE_DATA::ID => {
34165 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
34166 .map(Self::VICON_POSITION_ESTIMATE)
34167 }
34168 VIDEO_STREAM_INFORMATION_DATA::ID => {
34169 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
34170 .map(Self::VIDEO_STREAM_INFORMATION)
34171 }
34172 VIDEO_STREAM_STATUS_DATA::ID => {
34173 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
34174 }
34175 VISION_POSITION_ESTIMATE_DATA::ID => {
34176 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34177 .map(Self::VISION_POSITION_ESTIMATE)
34178 }
34179 VISION_SPEED_ESTIMATE_DATA::ID => {
34180 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
34181 }
34182 WHEEL_DISTANCE_DATA::ID => {
34183 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
34184 }
34185 WIFI_CONFIG_AP_DATA::ID => {
34186 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
34187 }
34188 WINCH_STATUS_DATA::ID => {
34189 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
34190 }
34191 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
34192 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
34193 }
34194 }
34195 fn message_name(&self) -> &'static str {
34196 match self {
34197 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34198 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34199 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34200 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34201 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34202 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34203 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34204 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34205 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34206 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34207 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34208 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34209 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34210 }
34211 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34212 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34213 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34214 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34215 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34216 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34217 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34218 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34219 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34220 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34221 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34222 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34223 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34224 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34225 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
34226 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34227 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34228 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34229 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34230 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34231 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34232 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34233 Self::COLLISION(..) => COLLISION_DATA::NAME,
34234 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34235 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34236 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34237 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34238 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34239 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
34240 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34241 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34242 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME,
34243 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME,
34244 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::NAME,
34245 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
34246 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34247 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34248 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34249 Self::DEBUG(..) => DEBUG_DATA::NAME,
34250 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34251 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34252 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34253 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
34254 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34255 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34256 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34257 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34258 Self::EVENT(..) => EVENT_DATA::NAME,
34259 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34260 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
34261 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34262 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34263 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34264 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34265 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34266 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34267 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34268 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34269 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34270 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34271 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34272 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34273 }
34274 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34275 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34276 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34277 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34278 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34279 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
34280 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34281 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34282 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34283 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34284 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34285 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34286 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34287 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34288 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34289 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::NAME,
34290 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
34291 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME
34292 }
34293 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34294 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34295 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34296 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34297 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34298 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34299 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34300 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34301 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34302 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34303 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34304 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34305 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34306 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34307 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34308 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34309 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
34310 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34311 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34312 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34313 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34314 }
34315 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34316 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34317 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34318 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34319 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34320 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34321 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34322 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34323 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34324 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34325 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
34326 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34327 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34328 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34329 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
34330 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34331 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34332 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34333 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
34334 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34335 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34336 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
34337 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34338 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34339 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34340 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
34341 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34342 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34343 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34344 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34345 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
34346 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34347 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34348 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34349 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34350 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34351 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34352 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34353 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34354 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34355 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34356 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34357 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34358 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34359 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34360 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34361 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
34362 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34363 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34364 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34365 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34366 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34367 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34368 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34369 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34370 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
34371 Self::PING(..) => PING_DATA::NAME,
34372 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34373 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34374 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34375 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34376 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34377 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34378 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34379 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34380 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34381 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34382 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34383 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34384 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34385 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34386 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34387 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34388 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34389 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34390 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34391 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34392 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34393 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34394 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34395 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34396 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34397 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34398 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
34399 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34400 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34401 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34402 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34403 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34404 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34405 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34406 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34407 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34408 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34409 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34410 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34411 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34412 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34413 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34414 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34415 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34416 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34417 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34418 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34419 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34420 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34421 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34422 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34423 }
34424 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34425 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34426 }
34427 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34428 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34429 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34430 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34431 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34432 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
34433 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34434 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34435 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
34436 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34437 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34438 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34439 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34440 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34441 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34442 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34443 }
34444 }
34445 fn message_id(&self) -> u32 {
34446 match self {
34447 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34448 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34449 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34450 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34451 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34452 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34453 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34454 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34455 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34456 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34457 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34458 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34459 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34460 }
34461 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34462 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34463 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34464 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34465 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34466 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34467 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34468 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34469 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34470 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34471 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34472 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34473 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34474 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34475 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34476 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34477 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34478 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34479 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34480 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34481 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34482 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34483 Self::COLLISION(..) => COLLISION_DATA::ID,
34484 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34485 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34486 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34487 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34488 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34489 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34490 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34491 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34492 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID,
34493 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID,
34494 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::ID,
34495 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34496 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34497 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34498 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34499 Self::DEBUG(..) => DEBUG_DATA::ID,
34500 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34501 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34502 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34503 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34504 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34505 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34506 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34507 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34508 Self::EVENT(..) => EVENT_DATA::ID,
34509 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34510 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34511 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34512 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34513 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34514 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34515 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34516 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34517 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34518 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34519 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34520 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34521 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34522 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34523 }
34524 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34525 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34526 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34527 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34528 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34529 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34530 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34531 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34532 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34533 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34534 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34535 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34536 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34537 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34538 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34539 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::ID,
34540 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
34541 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID
34542 }
34543 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34544 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34545 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34546 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34547 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34548 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34549 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34550 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34551 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34552 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34553 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34554 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34555 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34556 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34557 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34558 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34559 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34560 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34561 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34562 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34563 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34564 }
34565 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34566 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34567 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34568 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34569 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34570 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34571 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34572 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34573 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34574 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34575 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34576 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34577 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34578 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34579 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34580 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34581 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34582 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34583 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34584 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34585 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34586 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34587 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34588 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34589 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34590 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34591 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34592 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34593 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34594 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34595 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34596 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34597 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34598 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34599 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34600 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34601 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34602 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34603 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34604 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34605 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34606 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34607 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34608 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34609 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34610 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34611 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34612 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34613 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34614 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34615 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34616 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34617 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34618 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34619 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34620 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34621 Self::PING(..) => PING_DATA::ID,
34622 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34623 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34624 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34625 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34626 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34627 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34628 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34629 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34630 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34631 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34632 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34633 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34634 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34635 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34636 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34637 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34638 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34639 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34640 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34641 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34642 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34643 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34644 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34645 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34646 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34647 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34648 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34649 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34650 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34651 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34652 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34653 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34654 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34655 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34656 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34657 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34658 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34659 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34660 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34661 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34662 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34663 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34664 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34665 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34666 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34667 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34668 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34669 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34670 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34671 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34672 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34673 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34674 }
34675 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34676 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34677 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34678 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34679 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34680 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34681 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34682 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34683 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34684 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34685 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34686 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34687 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34688 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34689 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34690 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34691 }
34692 }
34693 fn message_id_from_name(name: &str) -> Option<u32> {
34694 match name {
34695 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34696 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34697 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34698 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34699 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34700 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34701 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34702 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34703 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34704 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34705 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34706 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34707 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34708 }
34709 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34710 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34711 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34712 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34713 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34714 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34715 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34716 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34717 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34718 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34719 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34720 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34721 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34722 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34723 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34724 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34725 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34726 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34727 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34728 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34729 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34730 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34731 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34732 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34733 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34734 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34735 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34736 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34737 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34738 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34739 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34740 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME => {
34741 Some(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID)
34742 }
34743 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME => {
34744 Some(CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID)
34745 }
34746 CUBEPILOT_RAW_RC_DATA::NAME => Some(CUBEPILOT_RAW_RC_DATA::ID),
34747 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34748 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34749 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34750 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34751 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34752 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34753 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34754 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34755 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34756 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34757 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34758 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34759 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34760 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34761 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34762 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34763 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34764 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34765 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34766 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34767 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34768 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34769 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34770 }
34771 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34772 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34773 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34774 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34775 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34776 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34777 }
34778 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34779 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34780 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34781 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34782 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34783 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34784 }
34785 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34786 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34787 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34788 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34789 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34790 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34791 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34792 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34793 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34794 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34795 HERELINK_TELEM_DATA::NAME => Some(HERELINK_TELEM_DATA::ID),
34796 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME => {
34797 Some(HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID)
34798 }
34799 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34800 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34801 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34802 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34803 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34804 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34805 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34806 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34807 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34808 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34809 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34810 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34811 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34812 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34813 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34814 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34815 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34816 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34817 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34818 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34819 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34820 }
34821 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34822 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34823 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34824 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34825 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34826 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34827 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34828 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34829 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34830 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34831 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34832 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34833 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34834 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34835 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34836 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34837 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34838 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34839 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34840 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34841 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34842 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34843 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34844 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34845 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34846 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34847 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34848 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34849 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34850 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34851 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34852 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34853 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34854 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34855 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34856 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34857 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34858 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34859 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34860 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34861 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34862 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34863 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34864 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34865 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34866 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34867 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34868 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34869 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34870 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34871 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34872 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34873 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34874 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34875 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34876 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34877 PING_DATA::NAME => Some(PING_DATA::ID),
34878 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34879 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34880 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34881 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34882 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34883 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34884 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34885 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34886 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34887 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34888 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34889 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34890 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34891 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34892 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34893 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34894 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34895 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34896 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34897 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34898 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34899 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34900 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34901 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34902 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34903 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34904 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34905 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34906 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34907 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34908 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34909 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34910 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34911 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34912 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34913 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34914 }
34915 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34916 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34917 }
34918 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34919 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34920 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34921 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34922 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34923 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34924 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34925 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34926 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34927 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34928 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34929 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34930 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34931 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34932 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34933 }
34934 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34935 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34936 }
34937 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34938 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34939 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34940 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34941 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34942 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34943 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34944 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34945 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34946 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34947 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34948 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34949 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34950 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34951 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34952 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34953 _ => None,
34954 }
34955 }
34956 fn default_message_from_id(id: u32) -> Option<Self> {
34957 match id {
34958 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34959 ACTUATOR_CONTROL_TARGET_DATA::default(),
34960 )),
34961 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34962 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34963 )),
34964 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34965 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34966 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34967 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34968 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34969 ATTITUDE_QUATERNION_DATA::default(),
34970 )),
34971 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34972 ATTITUDE_QUATERNION_COV_DATA::default(),
34973 )),
34974 ATTITUDE_TARGET_DATA::ID => {
34975 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34976 }
34977 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34978 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34979 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34980 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34981 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34982 ))
34983 }
34984 AUTOPILOT_VERSION_DATA::ID => {
34985 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34986 }
34987 AVAILABLE_MODES_DATA::ID => {
34988 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34989 }
34990 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34991 AVAILABLE_MODES_MONITOR_DATA::default(),
34992 )),
34993 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34994 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34995 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34996 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34997 CAMERA_CAPTURE_STATUS_DATA::default(),
34998 )),
34999 CAMERA_FOV_STATUS_DATA::ID => {
35000 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
35001 }
35002 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35003 CAMERA_IMAGE_CAPTURED_DATA::default(),
35004 )),
35005 CAMERA_INFORMATION_DATA::ID => {
35006 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
35007 }
35008 CAMERA_SETTINGS_DATA::ID => {
35009 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
35010 }
35011 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35012 CAMERA_THERMAL_RANGE_DATA::default(),
35013 )),
35014 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35015 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
35016 )),
35017 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35018 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
35019 )),
35020 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
35021 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
35022 CAN_FILTER_MODIFY_DATA::ID => {
35023 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
35024 }
35025 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
35026 CELLULAR_CONFIG_DATA::ID => {
35027 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
35028 }
35029 CELLULAR_STATUS_DATA::ID => {
35030 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
35031 }
35032 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35033 CHANGE_OPERATOR_CONTROL_DATA::default(),
35034 )),
35035 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35036 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
35037 )),
35038 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
35039 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
35040 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
35041 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
35042 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
35043 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35044 COMPONENT_INFORMATION_DATA::default(),
35045 )),
35046 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35047 COMPONENT_INFORMATION_BASIC_DATA::default(),
35048 )),
35049 COMPONENT_METADATA_DATA::ID => {
35050 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
35051 }
35052 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35053 CONTROL_SYSTEM_STATE_DATA::default(),
35054 )),
35055 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
35056 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::default(),
35057 )),
35058 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
35059 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
35060 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::default(),
35061 ))
35062 }
35063 CUBEPILOT_RAW_RC_DATA::ID => {
35064 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::default()))
35065 }
35066 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35067 CURRENT_EVENT_SEQUENCE_DATA::default(),
35068 )),
35069 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
35070 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
35071 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35072 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
35073 )),
35074 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
35075 DEBUG_FLOAT_ARRAY_DATA::ID => {
35076 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
35077 }
35078 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
35079 DISTANCE_SENSOR_DATA::ID => {
35080 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
35081 }
35082 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
35083 ENCAPSULATED_DATA_DATA::ID => {
35084 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
35085 }
35086 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
35087 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
35088 ESTIMATOR_STATUS_DATA::ID => {
35089 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
35090 }
35091 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
35092 EXTENDED_SYS_STATE_DATA::ID => {
35093 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
35094 }
35095 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
35096 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35097 FILE_TRANSFER_PROTOCOL_DATA::default(),
35098 )),
35099 FLIGHT_INFORMATION_DATA::ID => {
35100 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
35101 }
35102 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
35103 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
35104 GENERATOR_STATUS_DATA::ID => {
35105 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
35106 }
35107 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35108 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
35109 )),
35110 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35111 GIMBAL_DEVICE_INFORMATION_DATA::default(),
35112 )),
35113 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35114 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
35115 )),
35116 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35117 GIMBAL_MANAGER_INFORMATION_DATA::default(),
35118 )),
35119 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35120 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35121 )),
35122 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35123 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35124 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35125 ))
35126 }
35127 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35128 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
35129 )),
35130 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35131 GIMBAL_MANAGER_STATUS_DATA::default(),
35132 )),
35133 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35134 GLOBAL_POSITION_INT_DATA::default(),
35135 )),
35136 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35137 GLOBAL_POSITION_INT_COV_DATA::default(),
35138 )),
35139 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35140 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35141 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
35142 ))
35143 }
35144 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
35145 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
35146 GPS_GLOBAL_ORIGIN_DATA::ID => {
35147 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
35148 }
35149 GPS_INJECT_DATA_DATA::ID => {
35150 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
35151 }
35152 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35153 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35154 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
35155 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
35156 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
35157 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35158 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::default())),
35159 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
35160 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
35161 HERELINK_VIDEO_STREAM_INFORMATION_DATA::default(),
35162 ))
35163 }
35164 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35165 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35166 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35167 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35168 HIL_ACTUATOR_CONTROLS_DATA::default(),
35169 )),
35170 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
35171 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35172 HIL_OPTICAL_FLOW_DATA::ID => {
35173 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
35174 }
35175 HIL_RC_INPUTS_RAW_DATA::ID => {
35176 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35177 }
35178 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35179 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
35180 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35181 HIL_STATE_QUATERNION_DATA::default(),
35182 )),
35183 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35184 HYGROMETER_SENSOR_DATA::ID => {
35185 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
35186 }
35187 ILLUMINATOR_STATUS_DATA::ID => {
35188 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
35189 }
35190 ISBD_LINK_STATUS_DATA::ID => {
35191 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35192 }
35193 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
35194 LINK_NODE_STATUS_DATA::ID => {
35195 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
35196 }
35197 LOCAL_POSITION_NED_DATA::ID => {
35198 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35199 }
35200 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35201 LOCAL_POSITION_NED_COV_DATA::default(),
35202 )),
35203 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35204 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35205 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35206 ))
35207 }
35208 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35209 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35210 LOGGING_DATA_ACKED_DATA::ID => {
35211 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
35212 }
35213 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35214 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35215 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
35216 LOG_REQUEST_DATA_DATA::ID => {
35217 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35218 }
35219 LOG_REQUEST_END_DATA::ID => {
35220 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
35221 }
35222 LOG_REQUEST_LIST_DATA::ID => {
35223 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35224 }
35225 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35226 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
35227 MANUAL_SETPOINT_DATA::ID => {
35228 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35229 }
35230 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35231 MESSAGE_INTERVAL_DATA::ID => {
35232 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
35233 }
35234 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
35235 MISSION_CLEAR_ALL_DATA::ID => {
35236 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
35237 }
35238 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35239 MISSION_CURRENT_DATA::ID => {
35240 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
35241 }
35242 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
35243 MISSION_ITEM_INT_DATA::ID => {
35244 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35245 }
35246 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35247 MISSION_ITEM_REACHED_DATA::default(),
35248 )),
35249 MISSION_REQUEST_DATA::ID => {
35250 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
35251 }
35252 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35253 MISSION_REQUEST_INT_DATA::default(),
35254 )),
35255 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35256 MISSION_REQUEST_LIST_DATA::default(),
35257 )),
35258 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35259 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
35260 )),
35261 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35262 MISSION_SET_CURRENT_DATA::default(),
35263 )),
35264 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35265 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
35266 )),
35267 MOUNT_ORIENTATION_DATA::ID => {
35268 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35269 }
35270 NAMED_VALUE_FLOAT_DATA::ID => {
35271 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35272 }
35273 NAMED_VALUE_INT_DATA::ID => {
35274 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35275 }
35276 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35277 NAV_CONTROLLER_OUTPUT_DATA::default(),
35278 )),
35279 OBSTACLE_DISTANCE_DATA::ID => {
35280 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35281 }
35282 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35283 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35284 ONBOARD_COMPUTER_STATUS_DATA::default(),
35285 )),
35286 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35287 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35288 )),
35289 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35290 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35291 )),
35292 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35293 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
35294 )),
35295 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35296 OPEN_DRONE_ID_LOCATION_DATA::default(),
35297 )),
35298 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35299 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35300 )),
35301 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35302 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35303 )),
35304 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35305 OPEN_DRONE_ID_SELF_ID_DATA::default(),
35306 )),
35307 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35308 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35309 )),
35310 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35311 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35312 )),
35313 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35314 OPTICAL_FLOW_RAD_DATA::ID => {
35315 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35316 }
35317 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35318 ORBIT_EXECUTION_STATUS_DATA::default(),
35319 )),
35320 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
35321 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35322 PARAM_EXT_REQUEST_LIST_DATA::default(),
35323 )),
35324 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35325 PARAM_EXT_REQUEST_READ_DATA::default(),
35326 )),
35327 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35328 PARAM_EXT_VALUE_DATA::ID => {
35329 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35330 }
35331 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35332 PARAM_REQUEST_LIST_DATA::ID => {
35333 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35334 }
35335 PARAM_REQUEST_READ_DATA::ID => {
35336 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35337 }
35338 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
35339 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
35340 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35341 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35342 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
35343 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35344 POSITION_TARGET_GLOBAL_INT_DATA::default(),
35345 )),
35346 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35347 POSITION_TARGET_LOCAL_NED_DATA::default(),
35348 )),
35349 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35350 PROTOCOL_VERSION_DATA::ID => {
35351 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35352 }
35353 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35354 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
35355 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
35356 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35357 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35358 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35359 RC_CHANNELS_OVERRIDE_DATA::default(),
35360 )),
35361 RC_CHANNELS_RAW_DATA::ID => {
35362 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35363 }
35364 RC_CHANNELS_SCALED_DATA::ID => {
35365 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35366 }
35367 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35368 REQUEST_DATA_STREAM_DATA::default(),
35369 )),
35370 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
35371 RESOURCE_REQUEST_DATA::ID => {
35372 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
35373 }
35374 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35375 RESPONSE_EVENT_ERROR_DATA::default(),
35376 )),
35377 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35378 SAFETY_ALLOWED_AREA_DATA::default(),
35379 )),
35380 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35381 SAFETY_SET_ALLOWED_AREA_DATA::default(),
35382 )),
35383 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
35384 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35385 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35386 SCALED_PRESSURE_DATA::ID => {
35387 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
35388 }
35389 SCALED_PRESSURE2_DATA::ID => {
35390 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35391 }
35392 SCALED_PRESSURE3_DATA::ID => {
35393 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
35394 }
35395 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
35396 SERVO_OUTPUT_RAW_DATA::ID => {
35397 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
35398 }
35399 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35400 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35401 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35402 )),
35403 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35404 SET_ATTITUDE_TARGET_DATA::default(),
35405 )),
35406 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35407 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
35408 )),
35409 SET_HOME_POSITION_DATA::ID => {
35410 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
35411 }
35412 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
35413 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35414 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
35415 )),
35416 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35417 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
35418 )),
35419 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35420 SMART_BATTERY_INFO_DATA::ID => {
35421 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35422 }
35423 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35424 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35425 STORAGE_INFORMATION_DATA::default(),
35426 )),
35427 SUPPORTED_TUNES_DATA::ID => {
35428 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
35429 }
35430 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35431 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
35432 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35433 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
35434 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
35435 TERRAIN_REQUEST_DATA::ID => {
35436 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
35437 }
35438 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
35439 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35440 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35441 )),
35442 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35443 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35444 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
35445 ))
35446 }
35447 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35448 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35449 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35450 ))
35451 }
35452 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35453 UAVCAN_NODE_INFO_DATA::ID => {
35454 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35455 }
35456 UAVCAN_NODE_STATUS_DATA::ID => {
35457 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35458 }
35459 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35460 UTM_GLOBAL_POSITION_DATA::default(),
35461 )),
35462 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35463 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35464 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35465 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35466 VICON_POSITION_ESTIMATE_DATA::default(),
35467 )),
35468 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35469 VIDEO_STREAM_INFORMATION_DATA::default(),
35470 )),
35471 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35472 VIDEO_STREAM_STATUS_DATA::default(),
35473 )),
35474 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35475 VISION_POSITION_ESTIMATE_DATA::default(),
35476 )),
35477 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35478 VISION_SPEED_ESTIMATE_DATA::default(),
35479 )),
35480 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35481 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35482 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35483 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35484 _ => None,
35485 }
35486 }
35487 #[cfg(feature = "arbitrary")]
35488 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35489 match id {
35490 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35491 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35492 )),
35493 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35494 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35495 )),
35496 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35497 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35498 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35499 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35500 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35501 ATTITUDE_QUATERNION_DATA::random(rng),
35502 )),
35503 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35504 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35505 )),
35506 ATTITUDE_TARGET_DATA::ID => {
35507 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35508 }
35509 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35510 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35511 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35512 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35513 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35514 ))
35515 }
35516 AUTOPILOT_VERSION_DATA::ID => {
35517 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35518 }
35519 AVAILABLE_MODES_DATA::ID => {
35520 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35521 }
35522 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35523 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35524 )),
35525 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35526 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35527 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35528 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35529 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35530 )),
35531 CAMERA_FOV_STATUS_DATA::ID => {
35532 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35533 }
35534 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35535 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35536 )),
35537 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35538 CAMERA_INFORMATION_DATA::random(rng),
35539 )),
35540 CAMERA_SETTINGS_DATA::ID => {
35541 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35542 }
35543 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35544 CAMERA_THERMAL_RANGE_DATA::random(rng),
35545 )),
35546 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35547 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35548 )),
35549 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35550 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35551 )),
35552 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35553 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35554 CAN_FILTER_MODIFY_DATA::ID => {
35555 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35556 }
35557 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35558 CELLULAR_CONFIG_DATA::ID => {
35559 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35560 }
35561 CELLULAR_STATUS_DATA::ID => {
35562 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35563 }
35564 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35565 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35566 )),
35567 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35568 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35569 )),
35570 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35571 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35572 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35573 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35574 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35575 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35576 COMPONENT_INFORMATION_DATA::random(rng),
35577 )),
35578 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35579 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35580 )),
35581 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35582 COMPONENT_METADATA_DATA::random(rng),
35583 )),
35584 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35585 CONTROL_SYSTEM_STATE_DATA::random(rng),
35586 )),
35587 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
35588 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::random(rng),
35589 )),
35590 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
35591 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
35592 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::random(rng),
35593 ))
35594 }
35595 CUBEPILOT_RAW_RC_DATA::ID => {
35596 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::random(rng)))
35597 }
35598 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35599 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35600 )),
35601 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35602 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35603 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35604 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35605 )),
35606 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35607 DEBUG_FLOAT_ARRAY_DATA::ID => {
35608 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35609 }
35610 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35611 DISTANCE_SENSOR_DATA::ID => {
35612 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35613 }
35614 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35615 ENCAPSULATED_DATA_DATA::ID => {
35616 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35617 }
35618 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35619 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35620 ESTIMATOR_STATUS_DATA::ID => {
35621 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35622 }
35623 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35624 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35625 EXTENDED_SYS_STATE_DATA::random(rng),
35626 )),
35627 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35628 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35629 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35630 )),
35631 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35632 FLIGHT_INFORMATION_DATA::random(rng),
35633 )),
35634 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35635 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35636 GENERATOR_STATUS_DATA::ID => {
35637 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35638 }
35639 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35640 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35641 )),
35642 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35643 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35644 )),
35645 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35646 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35647 )),
35648 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35649 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35650 )),
35651 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35652 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35653 )),
35654 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35655 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35656 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35657 ))
35658 }
35659 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35660 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35661 )),
35662 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35663 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35664 )),
35665 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35666 GLOBAL_POSITION_INT_DATA::random(rng),
35667 )),
35668 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35669 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35670 )),
35671 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35672 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35673 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35674 ))
35675 }
35676 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35677 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35678 GPS_GLOBAL_ORIGIN_DATA::ID => {
35679 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35680 }
35681 GPS_INJECT_DATA_DATA::ID => {
35682 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35683 }
35684 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35685 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35686 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35687 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35688 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35689 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35690 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::random(rng))),
35691 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
35692 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
35693 HERELINK_VIDEO_STREAM_INFORMATION_DATA::random(rng),
35694 ))
35695 }
35696 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35697 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35698 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35699 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35700 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35701 )),
35702 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35703 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35704 HIL_OPTICAL_FLOW_DATA::ID => {
35705 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35706 }
35707 HIL_RC_INPUTS_RAW_DATA::ID => {
35708 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35709 }
35710 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35711 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35712 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35713 HIL_STATE_QUATERNION_DATA::random(rng),
35714 )),
35715 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35716 HYGROMETER_SENSOR_DATA::ID => {
35717 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35718 }
35719 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35720 ILLUMINATOR_STATUS_DATA::random(rng),
35721 )),
35722 ISBD_LINK_STATUS_DATA::ID => {
35723 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35724 }
35725 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35726 LINK_NODE_STATUS_DATA::ID => {
35727 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35728 }
35729 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35730 LOCAL_POSITION_NED_DATA::random(rng),
35731 )),
35732 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35733 LOCAL_POSITION_NED_COV_DATA::random(rng),
35734 )),
35735 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35736 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35737 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35738 ))
35739 }
35740 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35741 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35742 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35743 LOGGING_DATA_ACKED_DATA::random(rng),
35744 )),
35745 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35746 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35747 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35748 LOG_REQUEST_DATA_DATA::ID => {
35749 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35750 }
35751 LOG_REQUEST_END_DATA::ID => {
35752 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35753 }
35754 LOG_REQUEST_LIST_DATA::ID => {
35755 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35756 }
35757 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35758 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35759 MANUAL_SETPOINT_DATA::ID => {
35760 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35761 }
35762 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35763 MESSAGE_INTERVAL_DATA::ID => {
35764 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35765 }
35766 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35767 MISSION_CLEAR_ALL_DATA::ID => {
35768 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35769 }
35770 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35771 MISSION_CURRENT_DATA::ID => {
35772 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35773 }
35774 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35775 MISSION_ITEM_INT_DATA::ID => {
35776 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35777 }
35778 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35779 MISSION_ITEM_REACHED_DATA::random(rng),
35780 )),
35781 MISSION_REQUEST_DATA::ID => {
35782 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35783 }
35784 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35785 MISSION_REQUEST_INT_DATA::random(rng),
35786 )),
35787 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35788 MISSION_REQUEST_LIST_DATA::random(rng),
35789 )),
35790 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35791 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35792 )),
35793 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35794 MISSION_SET_CURRENT_DATA::random(rng),
35795 )),
35796 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35797 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35798 )),
35799 MOUNT_ORIENTATION_DATA::ID => {
35800 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35801 }
35802 NAMED_VALUE_FLOAT_DATA::ID => {
35803 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35804 }
35805 NAMED_VALUE_INT_DATA::ID => {
35806 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35807 }
35808 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35809 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35810 )),
35811 OBSTACLE_DISTANCE_DATA::ID => {
35812 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35813 }
35814 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35815 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35816 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35817 )),
35818 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35819 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35820 )),
35821 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35822 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35823 )),
35824 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35825 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35826 )),
35827 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35828 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35829 )),
35830 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35831 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35832 )),
35833 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35834 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35835 )),
35836 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35837 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35838 )),
35839 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35840 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35841 )),
35842 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35843 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35844 )),
35845 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35846 OPTICAL_FLOW_RAD_DATA::ID => {
35847 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35848 }
35849 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35850 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35851 )),
35852 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35853 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35854 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35855 )),
35856 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35857 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35858 )),
35859 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35860 PARAM_EXT_VALUE_DATA::ID => {
35861 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35862 }
35863 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35864 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35865 PARAM_REQUEST_LIST_DATA::random(rng),
35866 )),
35867 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35868 PARAM_REQUEST_READ_DATA::random(rng),
35869 )),
35870 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35871 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35872 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35873 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35874 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35875 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35876 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35877 )),
35878 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35879 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35880 )),
35881 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35882 PROTOCOL_VERSION_DATA::ID => {
35883 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35884 }
35885 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35886 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35887 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35888 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35889 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35890 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35891 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35892 )),
35893 RC_CHANNELS_RAW_DATA::ID => {
35894 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35895 }
35896 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35897 RC_CHANNELS_SCALED_DATA::random(rng),
35898 )),
35899 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35900 REQUEST_DATA_STREAM_DATA::random(rng),
35901 )),
35902 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35903 RESOURCE_REQUEST_DATA::ID => {
35904 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35905 }
35906 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35907 RESPONSE_EVENT_ERROR_DATA::random(rng),
35908 )),
35909 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35910 SAFETY_ALLOWED_AREA_DATA::random(rng),
35911 )),
35912 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35913 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35914 )),
35915 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35916 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35917 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35918 SCALED_PRESSURE_DATA::ID => {
35919 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35920 }
35921 SCALED_PRESSURE2_DATA::ID => {
35922 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35923 }
35924 SCALED_PRESSURE3_DATA::ID => {
35925 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35926 }
35927 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35928 SERVO_OUTPUT_RAW_DATA::ID => {
35929 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35930 }
35931 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35932 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35933 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35934 )),
35935 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35936 SET_ATTITUDE_TARGET_DATA::random(rng),
35937 )),
35938 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35939 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35940 )),
35941 SET_HOME_POSITION_DATA::ID => {
35942 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35943 }
35944 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35945 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35946 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35947 )),
35948 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35949 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35950 )),
35951 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35952 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35953 SMART_BATTERY_INFO_DATA::random(rng),
35954 )),
35955 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35956 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35957 STORAGE_INFORMATION_DATA::random(rng),
35958 )),
35959 SUPPORTED_TUNES_DATA::ID => {
35960 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35961 }
35962 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35963 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35964 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35965 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35966 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35967 TERRAIN_REQUEST_DATA::ID => {
35968 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35969 }
35970 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35971 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35972 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35973 )),
35974 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35975 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35976 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35977 ))
35978 }
35979 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35980 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35981 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35982 ))
35983 }
35984 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35985 UAVCAN_NODE_INFO_DATA::ID => {
35986 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35987 }
35988 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35989 UAVCAN_NODE_STATUS_DATA::random(rng),
35990 )),
35991 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35992 UTM_GLOBAL_POSITION_DATA::random(rng),
35993 )),
35994 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35995 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35996 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35997 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35998 VICON_POSITION_ESTIMATE_DATA::random(rng),
35999 )),
36000 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
36001 VIDEO_STREAM_INFORMATION_DATA::random(rng),
36002 )),
36003 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
36004 VIDEO_STREAM_STATUS_DATA::random(rng),
36005 )),
36006 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
36007 VISION_POSITION_ESTIMATE_DATA::random(rng),
36008 )),
36009 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
36010 VISION_SPEED_ESTIMATE_DATA::random(rng),
36011 )),
36012 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
36013 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
36014 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
36015 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
36016 _ => None,
36017 }
36018 }
36019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36020 match self {
36021 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36022 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
36023 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
36024 Self::AIS_VESSEL(body) => body.ser(version, bytes),
36025 Self::ALTITUDE(body) => body.ser(version, bytes),
36026 Self::ATTITUDE(body) => body.ser(version, bytes),
36027 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
36028 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
36029 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
36030 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
36031 Self::AUTH_KEY(body) => body.ser(version, bytes),
36032 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
36033 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
36034 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
36035 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
36036 Self::BATTERY_INFO(body) => body.ser(version, bytes),
36037 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
36038 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
36039 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
36040 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
36041 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
36042 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
36043 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
36044 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
36045 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
36046 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
36047 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
36048 Self::CANFD_FRAME(body) => body.ser(version, bytes),
36049 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
36050 Self::CAN_FRAME(body) => body.ser(version, bytes),
36051 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
36052 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
36053 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
36054 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
36055 Self::COLLISION(body) => body.ser(version, bytes),
36056 Self::COMMAND_ACK(body) => body.ser(version, bytes),
36057 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
36058 Self::COMMAND_INT(body) => body.ser(version, bytes),
36059 Self::COMMAND_LONG(body) => body.ser(version, bytes),
36060 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
36061 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
36062 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
36063 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
36064 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(body) => body.ser(version, bytes),
36065 Self::CUBEPILOT_FIRMWARE_UPDATE_START(body) => body.ser(version, bytes),
36066 Self::CUBEPILOT_RAW_RC(body) => body.ser(version, bytes),
36067 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
36068 Self::CURRENT_MODE(body) => body.ser(version, bytes),
36069 Self::DATA_STREAM(body) => body.ser(version, bytes),
36070 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
36071 Self::DEBUG(body) => body.ser(version, bytes),
36072 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
36073 Self::DEBUG_VECT(body) => body.ser(version, bytes),
36074 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
36075 Self::EFI_STATUS(body) => body.ser(version, bytes),
36076 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
36077 Self::ESC_INFO(body) => body.ser(version, bytes),
36078 Self::ESC_STATUS(body) => body.ser(version, bytes),
36079 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
36080 Self::EVENT(body) => body.ser(version, bytes),
36081 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
36082 Self::FENCE_STATUS(body) => body.ser(version, bytes),
36083 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
36084 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
36085 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
36086 Self::FUEL_STATUS(body) => body.ser(version, bytes),
36087 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
36088 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
36089 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
36090 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
36091 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
36092 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
36093 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
36094 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
36095 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
36096 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
36097 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
36098 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36099 Self::GPS2_RAW(body) => body.ser(version, bytes),
36100 Self::GPS2_RTK(body) => body.ser(version, bytes),
36101 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36102 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
36103 Self::GPS_INPUT(body) => body.ser(version, bytes),
36104 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
36105 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
36106 Self::GPS_RTK(body) => body.ser(version, bytes),
36107 Self::GPS_STATUS(body) => body.ser(version, bytes),
36108 Self::HEARTBEAT(body) => body.ser(version, bytes),
36109 Self::HERELINK_TELEM(body) => body.ser(version, bytes),
36110 Self::HERELINK_VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36111 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
36112 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
36113 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
36114 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
36115 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
36116 Self::HIL_GPS(body) => body.ser(version, bytes),
36117 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
36118 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
36119 Self::HIL_SENSOR(body) => body.ser(version, bytes),
36120 Self::HIL_STATE(body) => body.ser(version, bytes),
36121 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
36122 Self::HOME_POSITION(body) => body.ser(version, bytes),
36123 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
36124 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
36125 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
36126 Self::LANDING_TARGET(body) => body.ser(version, bytes),
36127 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
36128 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36129 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36130 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
36131 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36132 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36133 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
36134 Self::LOG_DATA(body) => body.ser(version, bytes),
36135 Self::LOG_ENTRY(body) => body.ser(version, bytes),
36136 Self::LOG_ERASE(body) => body.ser(version, bytes),
36137 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36138 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
36139 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36140 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36141 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
36142 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
36143 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36144 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
36145 Self::MISSION_ACK(body) => body.ser(version, bytes),
36146 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
36147 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36148 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
36149 Self::MISSION_ITEM(body) => body.ser(version, bytes),
36150 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36151 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
36152 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
36153 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36154 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
36155 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
36156 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
36157 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
36158 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36159 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36160 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36161 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
36162 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36163 Self::ODOMETRY(body) => body.ser(version, bytes),
36164 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36165 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36166 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36167 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
36168 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36169 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36170 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36171 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
36172 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36173 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36174 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36175 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
36176 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36177 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
36178 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
36179 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36180 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36181 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36182 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36183 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
36184 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36185 Self::PARAM_SET(body) => body.ser(version, bytes),
36186 Self::PARAM_VALUE(body) => body.ser(version, bytes),
36187 Self::PING(body) => body.ser(version, bytes),
36188 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36189 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
36190 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36191 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36192 Self::POWER_STATUS(body) => body.ser(version, bytes),
36193 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36194 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36195 Self::RAW_IMU(body) => body.ser(version, bytes),
36196 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
36197 Self::RAW_RPM(body) => body.ser(version, bytes),
36198 Self::RC_CHANNELS(body) => body.ser(version, bytes),
36199 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
36200 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
36201 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
36202 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36203 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
36204 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
36205 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
36206 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
36207 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
36208 Self::SCALED_IMU(body) => body.ser(version, bytes),
36209 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36210 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36211 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
36212 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36213 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
36214 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
36215 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
36216 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36217 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36218 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36219 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36220 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
36221 Self::SET_MODE(body) => body.ser(version, bytes),
36222 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36223 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36224 Self::SIM_STATE(body) => body.ser(version, bytes),
36225 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36226 Self::STATUSTEXT(body) => body.ser(version, bytes),
36227 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36228 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
36229 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
36230 Self::SYS_STATUS(body) => body.ser(version, bytes),
36231 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36232 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
36233 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
36234 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
36235 Self::TIMESYNC(body) => body.ser(version, bytes),
36236 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36237 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
36238 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
36239 Self::TUNNEL(body) => body.ser(version, bytes),
36240 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
36241 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36242 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
36243 Self::V2_EXTENSION(body) => body.ser(version, bytes),
36244 Self::VFR_HUD(body) => body.ser(version, bytes),
36245 Self::VIBRATION(body) => body.ser(version, bytes),
36246 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36247 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36248 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36249 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36250 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
36251 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
36252 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
36253 Self::WINCH_STATUS(body) => body.ser(version, bytes),
36254 Self::WIND_COV(body) => body.ser(version, bytes),
36255 }
36256 }
36257 fn extra_crc(id: u32) -> u8 {
36258 match id {
36259 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36260 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36261 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36262 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36263 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36264 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36265 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36266 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36267 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36268 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36269 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36270 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36271 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36272 }
36273 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36274 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36275 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36276 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36277 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36278 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36279 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36280 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36281 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36282 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36283 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36284 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36285 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36286 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36287 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36288 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36289 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36290 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36291 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36292 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36293 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36294 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36295 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36296 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36297 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36298 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36299 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36300 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36301 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36302 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36303 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36304 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
36305 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::EXTRA_CRC
36306 }
36307 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
36308 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::EXTRA_CRC
36309 }
36310 CUBEPILOT_RAW_RC_DATA::ID => CUBEPILOT_RAW_RC_DATA::EXTRA_CRC,
36311 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36312 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36313 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36314 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36315 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36316 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36317 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36318 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36319 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36320 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36321 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36322 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36323 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36324 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36325 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36326 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36327 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36328 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36329 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36330 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36331 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36332 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36333 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36334 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36335 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36336 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36337 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36338 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36339 }
36340 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36341 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36342 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36343 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36344 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36345 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36346 }
36347 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36348 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36349 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36350 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36351 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36352 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36353 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36354 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36355 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36356 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36357 HERELINK_TELEM_DATA::ID => HERELINK_TELEM_DATA::EXTRA_CRC,
36358 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
36359 HERELINK_VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC
36360 }
36361 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36362 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36363 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36364 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36365 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36366 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36367 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36368 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36369 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36370 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36371 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36372 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36373 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36374 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36375 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36376 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36377 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36378 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36379 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36380 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36381 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36382 }
36383 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36384 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36385 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36386 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36387 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36388 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36389 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36390 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36391 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36392 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36393 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36394 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36395 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36396 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36397 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36398 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36399 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36400 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36401 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36402 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36403 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36404 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36405 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36406 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36407 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36408 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36409 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36410 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36411 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36412 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36413 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36414 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36415 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36416 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36417 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36418 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36419 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36420 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36421 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36422 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36423 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36424 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36425 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36426 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36427 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36428 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36429 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36430 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36431 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36432 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36433 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36434 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36435 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36436 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36437 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36438 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36439 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36440 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36441 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36442 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36443 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36444 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36445 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36446 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36447 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36448 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36449 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36450 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36451 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36452 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36453 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36454 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36455 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36456 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36457 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36458 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36459 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36460 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36461 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36462 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36463 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36464 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36465 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36466 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36467 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36468 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36469 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36470 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36471 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36472 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36473 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36474 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36475 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36476 }
36477 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36478 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36479 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36480 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36481 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36482 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36483 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36484 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36485 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36486 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36487 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36488 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36489 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36490 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36491 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36492 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36493 }
36494 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36495 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36496 }
36497 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36498 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36499 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36500 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36501 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36502 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36503 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36504 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36505 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36506 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36507 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36508 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36509 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36510 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36511 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36512 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36513 _ => 0,
36514 }
36515 }
36516 fn target_system_id(&self) -> Option<u8> {
36517 match self {
36518 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36519 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36520 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36521 Self::CAN_FRAME(inner) => Some(inner.target_system),
36522 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36523 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36524 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36525 Self::COMMAND_INT(inner) => Some(inner.target_system),
36526 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36527 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_system),
36528 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_system),
36529 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36530 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36531 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36532 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36533 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36534 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36535 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36536 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36537 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36538 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36539 Self::LOG_ERASE(inner) => Some(inner.target_system),
36540 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36541 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36542 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36543 Self::MISSION_ACK(inner) => Some(inner.target_system),
36544 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36545 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36546 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36547 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36548 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36549 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36550 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36551 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36552 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36553 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36554 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36555 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36556 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36557 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36558 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36559 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36560 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36561 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36562 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36563 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36564 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36565 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36566 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36567 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36568 Self::PARAM_SET(inner) => Some(inner.target_system),
36569 Self::PING(inner) => Some(inner.target_system),
36570 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36571 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36572 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36573 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36574 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36575 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36576 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36577 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36578 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36579 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36580 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36581 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36582 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36583 Self::SET_MODE(inner) => Some(inner.target_system),
36584 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36585 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36586 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36587 Self::TIMESYNC(inner) => Some(inner.target_system),
36588 Self::TUNNEL(inner) => Some(inner.target_system),
36589 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36590 _ => None,
36591 }
36592 }
36593 fn target_component_id(&self) -> Option<u8> {
36594 match self {
36595 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36596 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36597 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36598 Self::CAN_FRAME(inner) => Some(inner.target_component),
36599 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36600 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36601 Self::COMMAND_INT(inner) => Some(inner.target_component),
36602 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36603 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_component),
36604 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_component),
36605 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36606 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36607 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36608 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36609 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36610 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36611 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36612 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36613 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36614 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36615 Self::LOG_ERASE(inner) => Some(inner.target_component),
36616 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36617 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36618 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36619 Self::MISSION_ACK(inner) => Some(inner.target_component),
36620 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36621 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36622 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36623 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36624 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36625 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36626 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36627 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36628 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36629 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36630 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36631 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36632 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36633 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36634 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36635 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36636 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36637 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36638 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36639 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36640 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36641 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36642 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36643 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36644 Self::PARAM_SET(inner) => Some(inner.target_component),
36645 Self::PING(inner) => Some(inner.target_component),
36646 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36647 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36648 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36649 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36650 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36651 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36652 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36653 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36654 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36655 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36656 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36657 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36658 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36659 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36660 Self::TIMESYNC(inner) => Some(inner.target_component),
36661 Self::TUNNEL(inner) => Some(inner.target_component),
36662 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36663 _ => None,
36664 }
36665 }
36666}